diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2014-05-27 17:39:26 +0200 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2014-05-27 17:39:26 +0200 |
commit | 1791a1e7a23c0aaf126ba099a73564e8c4e88cee (patch) | |
tree | a46d4a99fea9b2d7d391fa0bfb9a7cf5c6c76d90 /program | |
parent | f5de03208e80bec1a9be689b55c93d4faade2de0 (diff) |
Remove list row 'unfocused' state and keep 'selected' classes even when list loses focus. For visual distinguishing .focus tr.selected can be used
Diffstat (limited to 'program')
-rw-r--r-- | program/js/list.js | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/program/js/list.js b/program/js/list.js index 59651b8a2..62f1b1c9d 100644 --- a/program/js/list.js +++ b/program/js/list.js @@ -393,16 +393,8 @@ focus: function(e) if (this.focused) return; - var n, id; this.focused = true; - for (n in this.selection) { - id = this.selection[n]; - if (this.rows[id] && this.rows[id].obj) { - $(this.rows[id].obj).addClass('selected').removeClass('unfocused'); - } - } - if (e) rcube_event.cancel(e); @@ -430,15 +422,7 @@ focus: function(e) */ blur: function(e) { - var n, id; this.focused = false; - for (n in this.selection) { - id = this.selection[n]; - if (this.rows[id] && this.rows[id].obj) { - $(this.rows[id].obj).removeClass('selected focused').addClass('unfocused'); - } - } - $(this.list).removeClass('focus'); }, @@ -1087,7 +1071,7 @@ select_all: function(filter) this.highlight_row(n, true, true); } else { - $(this.rows[n].obj).removeClass('selected').removeClass('unfocused').removeAttr('aria-selected'); + $(this.rows[n].obj).removeClass('selected').removeAttr('aria-selected'); } } @@ -1144,7 +1128,7 @@ clear_selection: function(id, no_event) else { for (n in this.selection) if (this.rows[this.selection[n]]) { - $(this.rows[this.selection[n]].obj).removeClass('selected').removeClass('unfocused').removeAttr('aria-selected'); + $(this.rows[this.selection[n]].obj).removeClass('selected').removeAttr('aria-selected'); } this.selection = []; @@ -1223,7 +1207,7 @@ highlight_row: function(id, multiple, norecur) a_post = this.selection.slice(p+1, this.selection.length); this.selection = a_pre.concat(a_post); - $(this.rows[id].obj).removeClass('selected').removeClass('unfocused').removeAttr('aria-selected'); + $(this.rows[id].obj).removeClass('selected').removeAttr('aria-selected'); if (!norecur && !this.rows[id].expanded) this.highlight_children(id, false); } |