diff options
author | Aleksander Machniak <alec@alec.pl> | 2013-09-27 14:56:25 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2013-09-27 14:56:25 +0200 |
commit | 85fece2c4dbc6ef36ccd08d32e35501a1d131f81 (patch) | |
tree | c3519fcf360db3b77a91700ecfe0e905ee918fbf /program/js/list.js | |
parent | 170702fd136a877078705f24941893f686a835ce (diff) |
rcube_list_widget.rows is not an array - fixed checking if it's empty (#1489359)
Diffstat (limited to 'program/js/list.js')
-rw-r--r-- | program/js/list.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/program/js/list.js b/program/js/list.js index c2ad3f7c3..0f8d56c19 100644 --- a/program/js/list.js +++ b/program/js/list.js @@ -35,7 +35,7 @@ function rcube_list_widget(list, p) this.tbody; this.fixed_header; this.frame = null; - this.rows = []; + this.rows = {}; this.selection = []; this.rowcount = 0; this.colcount = 0; @@ -86,7 +86,7 @@ init: function() } if (this.tbody) { - this.rows = []; + this.rows = {}; this.rowcount = 0; var r, len, rows = this.tbody.childNodes; @@ -240,7 +240,7 @@ clear: function(sel) $(this.row_tagname() + ':not(.thead)', this.tbody).remove(); } - this.rows = []; + this.rows = {}; this.rowcount = 0; if (sel) @@ -471,7 +471,7 @@ click_row: function(e, id) this.in_selection_before = false; // row was double clicked - if (this.rows && dblclicked && this.in_selection(id)) { + if (this.rowcount && dblclicked && this.in_selection(id)) { this.triggerEvent('dblclick'); now = 0; } @@ -703,7 +703,7 @@ update_expando: function(uid, expanded) */ get_next_row: function() { - if (!this.rows) + if (!this.rowcount) return false; var last_selected_row = this.rows[this.last_selected], @@ -717,7 +717,7 @@ get_next_row: function() get_prev_row: function() { - if (!this.rows) + if (!this.rowcount) return false; var last_selected_row = this.rows[this.last_selected], @@ -969,7 +969,7 @@ in_selection: function(id) */ select_all: function(filter) { - if (!this.rows || !this.rows.length) + if (!this.rowcount) return false; // reset but remember selection first @@ -1001,7 +1001,7 @@ select_all: function(filter) */ invert_selection: function() { - if (!this.rows || !this.rows.length) + if (!this.rowcount) return false; // remember old selection |