summaryrefslogtreecommitdiff
path: root/program/js/list.js
diff options
context:
space:
mode:
Diffstat (limited to 'program/js/list.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