From a2f8fa236143b44f90e53c19806cfd0efa014857 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Mon, 12 May 2014 10:32:45 +0200 Subject: Set aria-selected and aria-expanded state attributes --- program/js/treelist.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'program/js/treelist.js') diff --git a/program/js/treelist.js b/program/js/treelist.js index fa3907894..8b55b32b1 100644 --- a/program/js/treelist.js +++ b/program/js/treelist.js @@ -323,7 +323,7 @@ function rcube_treelist_widget(node, p) */ function update_data() { - data = walk_list(container); + data = walk_list(container, 0); } /** @@ -332,6 +332,7 @@ function rcube_treelist_widget(node, p) function update_dom(node) { var li = id2dom(node.id); + 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'); me.triggerEvent('toggle', node); @@ -400,8 +401,9 @@ function rcube_treelist_widget(node, p) // add child list and toggle icon if (node.children && node.children.length) { + li.attr('aria-expanded', node.collapsed ? 'false' : 'true'); $('
 
').appendTo(li); - var ul = $('