diff options
author | Thomas Bruederli <thomas@roundcube.net> | 2014-05-12 17:05:44 +0200 |
---|---|---|
committer | Thomas Bruederli <thomas@roundcube.net> | 2014-05-12 17:05:44 +0200 |
commit | 5983ba959db52d232a074414cbb781a784ca916f (patch) | |
tree | 54858b8993b32193e4343c34835705d9722332b0 /program | |
parent | 596d43be13156b24325e45b3f3716722c61fafa2 (diff) |
Create treetoggle icons if necessary
Diffstat (limited to 'program')
-rw-r--r-- | program/js/treelist.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/program/js/treelist.js b/program/js/treelist.js index 353eb6be7..b5629a658 100644 --- a/program/js/treelist.js +++ b/program/js/treelist.js @@ -409,7 +409,7 @@ function rcube_treelist_widget(node, p) var li = $(e), sublist = li.children('ul'); var node = { id: dom2id(li), - classes: li.attr('class').split(' '), + classes: String(li.attr('class')).split(' '), virtual: li.hasClass('virtual'), html: li.children().first().get(0).outerHTML, children: walk_list(sublist) @@ -420,6 +420,8 @@ function rcube_treelist_widget(node, p) } if (node.children.length) { node.collapsed = sublist.css('display') == 'none'; + if (!li.children('div.treetoggle').length) + $('<div class="treetoggle '+(node.collapsed ? 'collapsed' : 'expanded') + '"> </div>').appendTo(li); } if (li.hasClass('selected')) { selection = node.id; |