From 905860a67c90a0bbf377e2a81e14d668b553fa30 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Wed, 18 Mar 2009 21:07:51 +0000 Subject: [PATCH] Arrow navigation in reporting module added. --- js/utils.js | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) 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