$html.find('> li:nth-child(1)').should.have.class('is-active');
$html.find('> li:nth-child(1) > ul').should.have.class('js-dropdown-active');
- document.activeElement.should.be.equal($html.find('> li:nth-child(1) > ul > li:nth-child(1) > a')[0]);
+ document.activeElement.should.be.equal($html.find('> li:nth-child(1) > ul > li:nth-child(1) > a')[0]);
});
it('moves focus to previous sub element on ARROW_UP', function () {
// Open it first
$html.find('> li:nth-child(1) > ul > li:nth-child(2)').should.have.class('is-active');
$html.find('> li:nth-child(1) > ul > li:nth-child(2) > ul').should.have.class('js-dropdown-active');
- document.activeElement.should.be.equal($html.find('> li:nth-child(1) > ul > li:nth-child(2) > ul > li:nth-child(1) > a')[0]);
+ document.activeElement.should.be.equal($html.find('> li:nth-child(1) > ul > li:nth-child(2) > ul > li:nth-child(1) > a')[0]);
});
});
describe('vertical', function() {
$html.find('> li:nth-child(1)').should.have.class('is-active');
$html.find('> li:nth-child(1) > ul').should.have.class('js-dropdown-active');
- document.activeElement.should.be.equal($html.find('> li:nth-child(1) > ul > li:nth-child(1) > a')[0]);
+ document.activeElement.should.be.equal($html.find('> li:nth-child(1) > ul > li:nth-child(1) > a')[0]);
});
it('moves focus to previous sub element on ARROW_UP', function () {
- $html = $(template).appendTo('body');
- plugin = new Foundation.DropdownMenu($html, {});
-
- // Open it first
plugin._show($html.find('> li:nth-child(1) > ul'));
$html.find('> li:nth-child(1) > ul > li:nth-child(2) > a').focus()
document.activeElement.should.be.equal($html.find('> li:nth-child(1) > ul > li:nth-child(1) > a')[0]);
});
it('opens child element of sub menu on ARROW_RIGHT', function() {
- $html = $(template).appendTo('body');
- plugin = new Foundation.DropdownMenu($html, {});
-
- // Open it first
plugin._show($html.find('> li:nth-child(1) > ul'));
$html.find('> li:nth-child(1) > ul > li:nth-child(2) > a').focus()
$html.find('> li:nth-child(1) > ul > li:nth-child(2)').should.have.class('is-active');
$html.find('> li:nth-child(1) > ul > li:nth-child(2) > ul').should.have.class('js-dropdown-active');
- document.activeElement.should.be.equal($html.find('> li:nth-child(1) > ul > li:nth-child(2) > ul > li:nth-child(1) > a')[0]);
+ document.activeElement.should.be.equal($html.find('> li:nth-child(1) > ul > li:nth-child(2) > ul > li:nth-child(1) > a')[0]);
});
});
});
-});
\ No newline at end of file
+});