this.$element.find('[data-submenu]').not('.is-active').slideUp(0);//.find('a').css('padding-left', '1rem');
this.$element.attr({
- 'role': 'tree',
'aria-multiselectable': this.options.multiOpen
});
'id': subId
});
});
- this.$element.find('li').attr({
- 'role': 'treeitem'
- });
var initPanes = this.$element.find('.is-active');
if (initPanes.length) {
initPanes.each(function() {
}
this.$element.attr({
- 'role': 'tree',
'aria-multiselectable': false
});
this.$submenuAnchors = this.$element.find('li.is-drilldown-submenu-parent').children('a');
this.$submenus = this.$submenuAnchors.parent('li').children('[data-submenu]').attr('role', 'group');
- this.$menuItems = this.$element.find('li').not('.js-drilldown-back').attr('role', 'treeitem').find('a');
+ this.$menuItems = this.$element.find('li').not('.js-drilldown-back').find('a');
// Set the main menu as current by default (unless a submenu is selected)
// Used to set the wrapper height when the drilldown is closed/reopened from any (sub)menu
// If target menu is root, focus first link & exit
if ($elem.is('[data-drilldown]')) {
- if (autoFocus === true) $elem.find('li[role="treeitem"] > a').first().focus();
+ if (autoFocus === true) $elem.find('li > a').first().focus();
if (this.options.autoHeight) this.$wrapper.css('height', $elem.data('calcHeight'));
return;
}
if (isLastChild === true) {
$(this).one(transitionend($(this)), () => {
if (autoFocus === true) {
- $elem.find('li[role="treeitem"] > a').first().focus();
+ $elem.find('li > a').first().focus();
}
});
}
$html = $(template).appendTo('body');
plugin = new Foundation.Drilldown($html, {});
- plugin.$element.should.have.attr('role', 'tree');
-
plugin.$element.find('[data-submenu]').each(function() {
$(this).should.have.attr('role', 'group');
$(this).should.have.attr('aria-hidden', 'true');
$(this).should.have.attr('aria-label', $(this).children('a').first().text());
});
- plugin.$element.find('li:not(.js-drilldown-back)').each(function() {
- $(this).should.have.attr('role', 'treeitem');
- });
});
});