Thomas Bruederli
2014-04-02 688fd769400984f99c4727b0283b227df7a2121b
Don't trigger 'select' event twice when selecting a list item
1 files modified
6 ■■■■ changed files
program/js/list.js 6 ●●●● patch | view | raw | blame | history
program/js/list.js
@@ -1035,7 +1035,7 @@
/**
 * Unselect selected row(s)
 */
clear_selection: function(id)
clear_selection: function(id, no_event)
{
  var n, num_select = this.selection.length;
@@ -1057,7 +1057,7 @@
    this.selection = [];
  }
  if (num_select && !this.selection.length)
  if (num_select && !this.selection.length && !no_event)
    this.triggerEvent('select');
},
@@ -1110,7 +1110,7 @@
  if (!multiple) {
    if (this.selection.length > 1 || !this.in_selection(id)) {
      this.clear_selection();
      this.clear_selection(null, true);
      this.selection[0] = id;
      $(this.rows[id].obj).addClass('selected');
    }