From 17a8fb353bd5141db990dfa467c8fc2634f8de58 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 20 Nov 2012 20:52:44 +0100 Subject: Fix keybord events on messages list in opera browser (#1488823) --- CHANGELOG | 1 + program/js/list.js | 49 ++++++++++--------------------------------------- 2 files changed, 11 insertions(+), 39 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index f1daa2384..fd6393fba 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Fix keybord events on messages list in opera browser (#1488823) - Fix selection of collapsed thread rows (#1488772) - Always save drafts with format=flowed in order to keep original line wraps (#1488799) - Fix wrapping of quoted text with format=flowed (#1488177) 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; -- cgit v1.2.3