summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2013-10-29 20:02:05 +0100
committerAleksander Machniak <machniak@kolabsys.com>2013-10-29 20:02:05 +0100
commita222f5c045c2a6c14b3c961b83a2d8ee9d3c9331 (patch)
tree81e900281665fb0146062a0b5245ead27b449a3e /program
parenta9d476f0123273b8ccd51ffb4669d6631a8b40d6 (diff)
Fix an issue where pressing minus key on contacts list was hiding list records (#1489393)
Diffstat (limited to 'program')
-rw-r--r--program/js/list.js20
1 files changed, 16 insertions, 4 deletions
diff --git a/program/js/list.js b/program/js/list.js
index 8843cd94a..8ad0a336b 100644
--- a/program/js/list.js
+++ b/program/js/list.js
@@ -1204,21 +1204,33 @@ use_arrow_key: function(keyCode, mod_key)
use_plusminus_key: function(keyCode, mod_key)
{
var selected_row = this.rows[this.last_selected];
- if (!selected_row)
+
+ if (!selected_row || !selected_row.has_children)
return;
if (keyCode == 32)
keyCode = selected_row.expanded ? 109 : 61;
- if (keyCode == 61 || keyCode == 107)
+
+ // expand
+ if (keyCode == 61 || keyCode == 107) {
+ if (selected_row.expanded)
+ return;
+
if (mod_key == CONTROL_KEY || this.multiexpand)
this.expand_all(selected_row);
else
- this.expand(selected_row);
- else
+ this.expand(selected_row);
+ }
+ // collapse
+ else {
+ if (!selected_row.expanded)
+ return;
+
if (mod_key == CONTROL_KEY || this.multiexpand)
this.collapse_all(selected_row);
else
this.collapse(selected_row);
+ }
this.update_expando(selected_row.uid, selected_row.expanded);