diff options
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; |