summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2008-06-12 06:47:20 +0000
committeralecpl <alec@alec.pl>2008-06-12 06:47:20 +0000
commite9b57bb8745118c2bc5302081aff8772cf6c8fee (patch)
treea3cc22b21c8e6e7344763ea81f190b78db55253c /program/js
parentf18911adb4a6d08fc85963a2f15f13fa869877ec (diff)
- #1484816: keypress (not keydown) for repeat
Diffstat (limited to 'program/js')
-rw-r--r--program/js/list.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/program/js/list.js b/program/js/list.js
index bdcf87932..a163f55ba 100644
--- a/program/js/list.js
+++ b/program/js/list.js
@@ -87,7 +87,7 @@ init: function()
// set body events
if (this.keyboard)
- rcube_event.add_listener({element:document, event:'keydown', object:this, method:'key_press'});
+ rcube_event.add_listener({element:document, event:'keypress', object:this, method:'key_press'});
}
},
@@ -557,6 +557,8 @@ key_press: function(e)
{
case 40:
case 38:
+ case 63233: // "down", in safari keypress
+ case 63232: // "up", in safari keypress
return this.use_arrow_key(keyCode, mod_key);
break;
@@ -576,9 +578,11 @@ key_press: function(e)
use_arrow_key: function(keyCode, mod_key)
{
var new_row;
- if (keyCode == 40) // down arrow key pressed
+ // Safari uses the nonstandard keycodes 63232/63233 for up/down, if we're
+ // using the keypress event (but not the keydown or keyup event).
+ if (keyCode == 40 || keyCode == 63233) // down arrow key pressed
new_row = this.get_next_row();
- else if (keyCode == 38) // up arrow key pressed
+ else if (keyCode == 38 || keyCode == 63232) // up arrow key pressed
new_row = this.get_prev_row();
if (new_row)