summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-11-20 20:52:44 +0100
committerAleksander Machniak <alec@alec.pl>2012-11-23 09:27:19 +0100
commita96db0f928ceafc9c24a4155f0ddecf13c8535f8 (patch)
treeab5af4575a3c0e8842e78a5f745e1ca578974142 /program
parentca68d75d1e0e5621476fee20c9040f73a3a0f7fe (diff)
Fix keybord events on messages list in opera browser (#1488823)
Conflicts: CHANGELOG
Diffstat (limited to 'program')
-rw-r--r--program/js/list.js49
1 files changed, 10 insertions, 39 deletions
diff --git a/program/js/list.js b/program/js/list.js
index 6ab6867e8..76ccaa535 100644
--- a/program/js/list.js
+++ b/program/js/list.js
@@ -90,10 +90,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'});
}
},
@@ -996,49 +994,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;