summaryrefslogtreecommitdiff
path: root/program
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2014-09-08 18:04:31 +0200
committerThomas Bruederli <thomas@roundcube.net>2014-09-08 18:04:37 +0200
commit4a25b69828ea77a4561c68f58cf96287cddb0b09 (patch)
tree067fbe327332e4fd6b1f7e499cb91c212f90bd70 /program
parentc489cc14797942fa8940e6451a964db875eb00a2 (diff)
Small tweaks for treelist interactions
Diffstat (limited to 'program')
-rw-r--r--program/js/treelist.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/program/js/treelist.js b/program/js/treelist.js
index a7cd7cd43..bb847d1e3 100644
--- a/program/js/treelist.js
+++ b/program/js/treelist.js
@@ -477,7 +477,7 @@ function rcube_treelist_widget(node, p)
*/
function update_dom(node)
{
- var li = id2dom(node.id);
+ var li = id2dom(node.id, true);
li.attr('aria-expanded', node.collapsed ? 'false' : 'true');
li.children('ul').first()[(node.collapsed ? 'hide' : 'show')]();
li.children('div.treetoggle').removeClass('collapsed expanded').addClass(node.collapsed ? 'collapsed' : 'expanded');
@@ -698,7 +698,8 @@ function rcube_treelist_widget(node, p)
node.childlistclass = sublist.attr('class');
}
if (node.children.length) {
- node.collapsed = sublist.css('display') == 'none';
+ if (node.collapsed === undefined)
+ node.collapsed = sublist.css('display') == 'none';
// apply saved state
state = get_state(node.id, node.collapsed);