Aleksander Machniak
2013-11-02 052a6a4d653ee061f3a9ff8abdb51102d5da44ce
Fix list record selection on lists with toggleselect:true, i.e. folder manager
- this is a regression in recent keyboard handling refactoring (#1489408)
1 files modified
14 ■■■■ changed files
program/js/list.js 14 ●●●● patch | view | raw | blame | history
program/js/list.js
@@ -412,15 +412,18 @@
  if (rcube_event.get_button(e) == 2)
    return true;
  this.in_selection_before = e && e.istouch || this.in_selection(id) ? id : false;
  // selects currently unselected row
  if (!(e && e.istouch || this.in_selection(id))) {
  if (!this.in_selection_before) {
    var mod_key = rcube_event.get_modifier(e);
    this.select_row(id, mod_key, false);
    this.select_row(id, mod_key, true);
  }
  if (this.draggable && this.selection.length && this.in_selection(id)) {
    this.drag_start = true;
    this.drag_mouse_start = rcube_event.get_mouse_pos(e);
    rcube_event.add_listener({event:'mousemove', object:this, method:'drag_mouse_move'});
    rcube_event.add_listener({event:'mouseup', object:this, method:'drag_mouse_up'});
    if (bw.touch) {
@@ -448,11 +451,12 @@
  var now = new Date().getTime(),
    dblclicked = now - this.rows[id].clicked < this.dblclick_time;
  // selects (or unselects currently selected) row
  if (!this.drag_active && !dblclicked)
  // unselects currently selected row
  if (!this.drag_active && !dblclicked && this.in_selection_before == id)
    this.select_row(id, rcube_event.get_modifier(e), true);
  this.drag_start = false;
  this.in_selection_before = false;
  // row was double clicked
  if (this.rowcount && dblclicked && this.in_selection(id)) {
@@ -772,6 +776,7 @@
select_row: function(id, mod_key, with_mouse)
{
  var select_before = this.selection.join(',');
  if (!this.multiselect)
    mod_key = 0;
@@ -802,6 +807,7 @@
        this.highlight_row(id, false);
        break;
    }
    this.multi_selecting = true;
  }