summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2008-08-22 10:54:45 +0000
committerthomascube <thomas@roundcube.net>2008-08-22 10:54:45 +0000
commit9e7a1b4167ebe12c91c6fe2429b834bdc2a435a3 (patch)
tree249a2112c5e8d89c449b5391dcbf5102b979f8d3 /program/js
parent26f5b0935ef4d8bc01e2b8581f7d7ed3c4508fc2 (diff)
Better fix for keyboard controls; does not disable all kind of keyboard events
Diffstat (limited to 'program/js')
-rw-r--r--program/js/list.js22
1 files changed, 21 insertions, 1 deletions
diff --git a/program/js/list.js b/program/js/list.js
index a83a8af6f..1986e8b25 100644
--- a/program/js/list.js
+++ b/program/js/list.js
@@ -88,7 +88,7 @@ init: function()
// set body events
if (this.keyboard) {
rcube_event.add_listener({element:document, event:'keyup', object:this, method:'key_press'});
- rcube_event.add_listener({element:document, event:'keydown', object:rcube_event, method:'cancel'});
+ rcube_event.add_listener({element:document, event:'keydown', object:this, method:'key_down'});
}
}
},
@@ -573,6 +573,26 @@ key_press: function(e)
return true;
},
+/**
+ * Handler for keydown events
+ */
+key_down: function(e)
+{
+ switch (rcube_event.get_keycode(e))
+ {
+ case 40:
+ case 38:
+ case 63233:
+ case 63232:
+ if (!rcube_event.get_modifier(e) && this.focused)
+ return rcube_event.cancel(e);
+
+ default:
+ }
+
+ return true;
+},
+
/**
* Special handling method for arrow keys