diff options
author | Aleksander Machniak <alec@alec.pl> | 2012-11-20 20:52:44 +0100 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2012-11-20 20:52:44 +0100 |
commit | 17a8fb353bd5141db990dfa467c8fc2634f8de58 (patch) | |
tree | f819eebb1aaeef594547ecde9fb63d70da0a347c /program/js | |
parent | 9290303e80801a31569386c1a030ca6ed7dd34b5 (diff) |
Fix keybord events on messages list in opera browser (#1488823)
Diffstat (limited to 'program/js')
-rw-r--r-- | program/js/list.js | 49 |
1 files changed, 10 insertions, 39 deletions
diff --git a/program/js/list.js b/program/js/list.js index 99c47d94a..660b74d85 100644 --- a/program/js/list.js +++ b/program/js/list.js @@ -88,10 +88,8 @@ init: function() this.frame = this.list.parentNode; // set body events - if (this.keyboard) { - rcube_event.add_listener({event:bw.opera?'keypress':'keydown', object:this, method:'key_press'}); - rcube_event.add_listener({event:'keydown', object:this, method:'key_down'}); - } + if (this.keyboard) + rcube_event.add_listener({event:'keydown', object:this, method:'key_press'}); } }, @@ -1007,49 +1005,22 @@ key_press: function(e) case 35: // End this.select_last(mod_key); return rcube_event.cancel(e); - default: - this.key_pressed = keyCode; - this.modkey = mod_key; - this.triggerEvent('keypress'); - this.modkey = 0; - - if (this.key_pressed == this.BACKSPACE_KEY) - return rcube_event.cancel(e); - } - - return true; -}, - -/** - * Handler for keydown events - */ -key_down: function(e) -{ - var target = e.target || {}; - if (this.focused != true || target.nodeName == 'INPUT' || target.nodeName == 'TEXTAREA' || target.nodeName == 'SELECT') - return true; - - switch (rcube_event.get_keycode(e)) { case 27: if (this.drag_active) - return this.drag_mouse_up(e); + return this.drag_mouse_up(e); if (this.col_drag_active) { this.selected_column = null; return this.column_drag_mouse_up(e); } + return rcube_event.cancel(e); + default: + this.key_pressed = keyCode; + this.modkey = mod_key; + this.triggerEvent('keypress'); + this.modkey = 0; - case 40: - case 38: - case 63233: - case 63232: - case 61: - case 107: - case 109: - case 32: - if (!rcube_event.get_modifier(e) && this.focused) + if (this.key_pressed == this.BACKSPACE_KEY) return rcube_event.cancel(e); - - default: } return true; |