Skip to content

Commit

Permalink
Navigation Menubar Example: Remove second example with dynamically ad…
Browse files Browse the repository at this point in the history
…ded ARIA attributes (pull #435)

To address issue #443, removed the second example where markup was being added dynamically, removed unnecessary js,  and fixed a bug in the HTML source code display.

Related to issue #410.
  • Loading branch information
jongund authored and mcking65 committed Aug 28, 2017
1 parent 90dca45 commit 0300f09
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 236 deletions.
8 changes: 0 additions & 8 deletions examples/menubar/menubar-1/js/MenubarItemLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,6 @@ var MenubarItem = function (domNode, menuObj) {
MenubarItem.prototype.init = function () {
this.domNode.tabIndex = -1;

this.domNode.setAttribute('role', 'menuitem');
this.domNode.setAttribute('aria-haspopup', 'true');
this.domNode.setAttribute('aria-expanded', 'false');

if (this.domNode.parentNode.tagName === 'LI') {
this.domNode.parentNode.setAttribute('role', 'none');
}

this.domNode.addEventListener('keydown', this.handleKeydown.bind(this));
this.domNode.addEventListener('click', this.handleClick.bind(this));
this.domNode.addEventListener('focus', this.handleFocus.bind(this));
Expand Down
1 change: 0 additions & 1 deletion examples/menubar/menubar-1/js/MenubarLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ var Menubar = function (domNode) {
Menubar.prototype.init = function () {
var menubarItem, childElement, menuElement, textContent, numItems;

this.domNode.setAttribute('role', 'menubar');

// Traverse the element children of menubarNode: configure each with
// menuitem role behavior and store reference in menuitems array.
Expand Down
8 changes: 0 additions & 8 deletions examples/menubar/menubar-1/js/PopupMenuItemLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@ var MenuItem = function (domNode, menuObj) {
MenuItem.prototype.init = function () {
this.domNode.tabIndex = -1;

if (!this.domNode.getAttribute('role')) {
this.domNode.setAttribute('role', 'menuitem');
}

if (this.domNode.parentNode.tagName === 'LI') {
this.domNode.parentNode.setAttribute('role', 'none');
}

this.domNode.addEventListener('keydown', this.handleKeydown.bind(this));
this.domNode.addEventListener('click', this.handleClick.bind(this));
this.domNode.addEventListener('focus', this.handleFocus.bind(this));
Expand Down
8 changes: 0 additions & 8 deletions examples/menubar/menubar-1/js/PopupMenuLinks.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,6 @@ PopupMenu.prototype.init = function () {
var childElement, menuElement, menuItem, textContent, numItems, label;

// Configure the domNode itself
this.domNode.tabIndex = -1;

this.domNode.setAttribute('role', 'menu');

if (!this.domNode.getAttribute('aria-labelledby') && !this.domNode.getAttribute('aria-label') && !this.domNode.getAttribute('title')) {
label = this.controller.domNode.innerHTML;
this.domNode.setAttribute('aria-label', label);
}

this.domNode.addEventListener('mouseover', this.handleMouseover.bind(this));
this.domNode.addEventListener('mouseout', this.handleMouseout.bind(this));
Expand Down
Loading

0 comments on commit 0300f09

Please sign in to comment.