summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-04-02 16:25:28 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-04-03 09:38:53 +0200
commitde3c333f4ea9fb087d87f172a454ab3ad9f0473e (patch)
tree720df95de9c142694ccadf775f732d3a32532024 /program/js
parent548b0ddee9d17b17cfc265ae19a9b87051be7333 (diff)
Don't trigger 'select' event twice when selecting a list item
Diffstat (limited to 'program/js')
-rw-r--r--program/js/list.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/program/js/list.js b/program/js/list.js
index d54b59d24..476edae4b 100644
--- a/program/js/list.js
+++ b/program/js/list.js
@@ -1035,7 +1035,7 @@ invert_selection: function()
/**
* 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 @@ clear_selection: function(id)
this.selection = [];
}
- if (num_select && !this.selection.length)
+ if (num_select && !this.selection.length && !no_event)
this.triggerEvent('select');
},
@@ -1110,7 +1110,7 @@ highlight_row: function(id, multiple, norecur)
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');
}