diff options
| author | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-09-05 06:53:53 +0000 |
|---|---|---|
| committer | thomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c> | 2007-09-05 06:53:53 +0000 |
| commit | 3e1b3647627f3de122a817d11c206382436eb0b7 (patch) | |
| tree | 9ed42d4e95e545105323ad5ce43b4dd8e9972240 | |
| parent | a7805cc204af06f77d545210c4ef7276ca30cef7 (diff) | |
Allso trigger events when selecting all/none list entries
git-svn-id: https://svn.roundcube.net/trunk@776 208e9e7b-5314-0410-a742-e7e81cd9613c
| -rw-r--r-- | roundcubemail/program/js/list.js | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/roundcubemail/program/js/list.js b/roundcubemail/program/js/list.js index c4f02402b..6a083a2e7 100644 --- a/roundcubemail/program/js/list.js +++ b/roundcubemail/program/js/list.js @@ -422,7 +422,8 @@ select_all: function(filter) if (!this.rows || !this.rows.length) return false; - // reset selection first + // reset but remember selection first + var select_before = this.selection.join(','); this.clear_selection(); for (var n in this.rows) @@ -434,7 +435,11 @@ select_all: function(filter) } } - return true; + // trigger event if selection changed + if (this.selection.join(',') != select_before) + this.trigger_event('select'); + + return true; }, @@ -443,14 +448,18 @@ select_all: function(filter) */ clear_selection: function() { - for(var n=0; n<this.selection.length; n++) + var num_select = this.selection.length; + for (var n=0; n<this.selection.length; n++) if (this.rows[this.selection[n]]) { this.set_classname(this.rows[this.selection[n]].obj, 'selected', false); this.set_classname(this.rows[this.selection[n]].obj, 'unfocused', false); } - this.selection = new Array(); + this.selection = new Array(); + + if (num_select) + this.trigger_event('select'); }, |
