- Disable message list keypress operations when CTRL key is pressed,

to workaround FF6 issue, where Ctrl+Pg(Up/Down) was changing list page
  and browser tab)
- Fix multiselection with Ctrl+Up/Down keys
release-0.7
alecpl 13 years ago
parent d43332a8a5
commit 699a25a822

@ -86,7 +86,7 @@ function rcube_webmail()
if (over) button_prop.over = over; if (over) button_prop.over = over;
this.buttons[command].push(button_prop); this.buttons[command].push(button_prop);
if (this.loaded) if (this.loaded)
init_button(command, button_prop); init_button(command, button_prop);
}; };
@ -1522,11 +1522,12 @@ function rcube_webmail()
this.msglist_keypress = function(list) this.msglist_keypress = function(list)
{ {
if (list.modkey == CONTROL_KEY)
return;
if (list.key_pressed == list.ENTER_KEY) if (list.key_pressed == list.ENTER_KEY)
this.command('show'); this.command('show');
else if (list.key_pressed == list.DELETE_KEY) else if (list.key_pressed == list.DELETE_KEY || list.key_pressed == list.BACKSPACE_KEY)
this.command('delete');
else if (list.key_pressed == list.BACKSPACE_KEY)
this.command('delete'); this.command('delete');
else if (list.key_pressed == 33) else if (list.key_pressed == 33)
this.command('previouspage'); this.command('previouspage');
@ -2496,7 +2497,7 @@ function rcube_webmail()
// if there is a trash mailbox defined and we're not currently in it // if there is a trash mailbox defined and we're not currently in it
else { else {
// if shift was pressed delete it immediately // if shift was pressed delete it immediately
if (list && list.shiftkey) { if (list && list.modkey == SHIFT_KEY) {
if (confirm(this.get_label('deletemessagesconfirm'))) if (confirm(this.get_label('deletemessagesconfirm')))
this.permanently_remove_messages(); this.permanently_remove_messages();
} }

@ -171,14 +171,12 @@ get_modifier: function(e)
var opcode = 0; var opcode = 0;
e = e || window.event; e = e || window.event;
if (bw.mac && e) { if (bw.mac && e)
opcode += (e.metaKey && CONTROL_KEY) + (e.shiftKey && SHIFT_KEY); opcode += (e.metaKey && CONTROL_KEY) + (e.shiftKey && SHIFT_KEY);
return opcode; else if (e)
}
if (e) {
opcode += (e.ctrlKey && CONTROL_KEY) + (e.shiftKey && SHIFT_KEY); opcode += (e.ctrlKey && CONTROL_KEY) + (e.shiftKey && SHIFT_KEY);
return opcode;
} return opcode;
}, },
/** /**

@ -36,7 +36,7 @@ function rcube_list_widget(list, p)
this.colcount = 0; this.colcount = 0;
this.subject_col = -1; this.subject_col = -1;
this.shiftkey = false; this.modkey = 0;
this.multiselect = false; this.multiselect = false;
this.multiexpand = false; this.multiexpand = false;
this.multi_selecting = false; this.multi_selecting = false;
@ -648,7 +648,7 @@ select_row: function(id, mod_key, with_mouse)
case CONTROL_KEY: case CONTROL_KEY:
if (!with_mouse) if (!with_mouse)
this.highlight_row(id, true); this.highlight_row(id, true);
break; break;
case CONTROL_SHIFT_KEY: case CONTROL_SHIFT_KEY:
this.shift_select(id, true); this.shift_select(id, true);
@ -962,7 +962,7 @@ key_press: function(e)
switch (keyCode) { switch (keyCode) {
case 40: case 40:
case 38: case 38:
case 63233: // "down", in safari keypress case 63233: // "down", in safari keypress
case 63232: // "up", in safari keypress case 63232: // "up", in safari keypress
// Stop propagation so that the browser doesn't scroll // Stop propagation so that the browser doesn't scroll
@ -976,7 +976,9 @@ key_press: function(e)
rcube_event.cancel(e); rcube_event.cancel(e);
var ret = this.use_plusminus_key(keyCode, mod_key); var ret = this.use_plusminus_key(keyCode, mod_key);
this.key_pressed = keyCode; this.key_pressed = keyCode;
this.modkey = mod_key;
this.triggerEvent('keypress'); this.triggerEvent('keypress');
this.modkey = 0;
return ret; return ret;
case 36: // Home case 36: // Home
this.select_first(mod_key); this.select_first(mod_key);
@ -985,11 +987,10 @@ key_press: function(e)
this.select_last(mod_key); this.select_last(mod_key);
return rcube_event.cancel(e); return rcube_event.cancel(e);
default: default:
this.shiftkey = e.shiftKey;
this.key_pressed = keyCode; this.key_pressed = keyCode;
this.modkey = mod_key;
this.triggerEvent('keypress'); this.triggerEvent('keypress');
// reset shiftkey flag, we need it only for registered events this.modkey = 0;
this.shiftkey = false;
if (this.key_pressed == this.BACKSPACE_KEY) if (this.key_pressed == this.BACKSPACE_KEY)
return rcube_event.cancel(e); return rcube_event.cancel(e);
@ -1044,7 +1045,7 @@ use_arrow_key: function(keyCode, mod_key)
new_row = this.get_prev_row(); new_row = this.get_prev_row();
if (new_row) { if (new_row) {
this.select_row(new_row.uid, mod_key, true); this.select_row(new_row.uid, mod_key, false);
this.scrollto(new_row.uid); this.scrollto(new_row.uid);
} }

Loading…
Cancel
Save