Index: app.js =================================================================== RCS file: /cvsroot/roundcubemail/roundcubemail/program/js/app.js,v retrieving revision 1.27 diff -r1.27 app.js 15a16,19 > // Constants > var CONTROL_KEY = 1; > var SHIFT_KEY = 2; > var CONTROL_SHIFT_KEY = 3; 999a1004 > // selects currently unselected row 1001,1003c1006,1025 < { < var ctrl = this.check_ctrlkey(e); < this.select(id, ctrl); --- > { > var mod_key = this.get_modifier(e); > if (!mod_key) { > this.select(id, false); > this.last_selected = id; > } else { > switch (mod_key) { > case SHIFT_KEY: { this.shift_select(id,false); break; } > case CONTROL_KEY: { > this.select(id, true); > this.last_selected = id; > break; > } > case CONTROL_SHIFT_KEY: { this.shift_select(id,true); break;} > default: { > this.select(id, false); > this.last_selected = id; > break; > } > } 1004a1027 > } 1020c1043 < var shift = this.check_shiftkey(e); --- > var mod_key = this.get_modifier(e); 1029,1031c1052,1071 < if (!this.drag_active && this.in_selection_before==id) < { < this.select(id, (shift && this.task!='settings')); --- > // unselects currently selected row > if (!this.drag_active && this.in_selection_before==id) { > if (!mod_key) { > this.last_selected = id; > this.select(id, false); > } else { > switch (mod_key) { > case SHIFT_KEY: { this.shift_select(id,false); break; } > case CONTROL_KEY: { > this.last_selected = id; > this.select(id, (this.task!='settings')); > break; > } > case CONTROL_SHIFT_KEY: {this.shift_select(id,true);break;} > default: { > this.select(id, false); > this.last_selected = id; > break; > } > } 1033c1073 < --- > } 1038c1078 < if (this.task=='mail' && this.list_rows && this.list_rows[id].clicked && !shift) --- > if (this.task=='mail' && this.list_rows && this.list_rows[id].clicked) 1135d1174 < 1152a1192,1213 > // select all rows from the last selected row to the current one, while deselecting all other rows > this.shift_select = function(id,control) > { > var from_rowIndex = this.list_rows[this.last_selected].obj.rowIndex; > var to_rowIndex = this.list_rows[id].obj.rowIndex; > > var i = ((from_rowIndex < to_rowIndex)? from_rowIndex : to_rowIndex); > var j = ((from_rowIndex > to_rowIndex)? from_rowIndex : to_rowIndex); > > // iterate through the entire message list > for (var n in this.list_rows) { > if ((this.list_rows[n].obj.rowIndex >= i) && (this.list_rows[n].obj.rowIndex <= j)) { > if (!this.in_selection(n)) > this.select(n, true); > } else { > if (this.in_selection(n) && !control) > this.select(n, true); > } > } > }; > > 2811a2873,2892 > > // returns modifier key (constants defined at top of file) > this.get_modifier = function(e) > { > var opcode = 0; > if (e = e || window.event) > { > opcode += (e.ctrlKey && CONTROL_KEY) + (e.shiftKey && SHIFT_KEY); > return opcode; > } > if (e.cancelBubble) > { > e.cancelBubble = true; > e.returnValue = false; > } > else if (e.preventDefault) > e.preventDefault(); > } > >