From: Janusz Dobrowolski Date: Wed, 18 Mar 2009 21:07:51 +0000 (+0000) Subject: Arrow navigation in reporting module added. X-Git-Tag: v2.4.2~19^2~1467 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=905860a67c90a0bbf377e2a81e14d668b553fa30;p=fa-stable.git Arrow navigation in reporting module added. --- diff --git a/js/utils.js b/js/utils.js index dc2b523d..25b6e19a 100644 --- a/js/utils.js +++ b/js/utils.js @@ -239,22 +239,24 @@ function setFocus(name, byId) { } /* Find closest element in neighbourhood and set focus. - dir is direction as arrow code. + dir is arrow keycode. */ -function move_focus(dir, e, neighbours) +function move_focus(dir, e0, neighbours) { - var p0 = element_pos(e); + var p0 = element_pos(e0); var t; var l=0; for(var i=0; ip0.y)) || (dir==38 && (p.yp0.x)))) { - var l1 = (p.y-p0.y)*(p.y-p0.y)+(p.x-p0.x)*(p.x-p0.x); - if ((l1p0.y)) || (dir==38 && (p.yp0.x)))) { + var l1 = (p.y-p0.y)*(p.y-p0.y)+(p.x-p0.x)*(p.x-p0.x); + if ((l1