From d5089cb3921165eac6a353cff4b65828f96f3146 Mon Sep 17 00:00:00 2001 From: Jon Gunderson Date: Mon, 28 Aug 2017 17:04:57 -0500 Subject: [PATCH] updated code for updating which font size is selected and added documentation for the aria-disabled property --- .../menubar/menubar-2/js/PopupMenuAction.js | 16 +++++++ .../menubar-2/js/PopupMenuItemAction.js | 17 ------- examples/menubar/menubar-2/menubar-2.html | 46 +++++++++++++++++-- 3 files changed, 57 insertions(+), 22 deletions(-) diff --git a/examples/menubar/menubar-2/js/PopupMenuAction.js b/examples/menubar/menubar-2/js/PopupMenuAction.js index d70ccfd9f7..a50bb256e0 100644 --- a/examples/menubar/menubar-2/js/PopupMenuAction.js +++ b/examples/menubar/menubar-2/js/PopupMenuAction.js @@ -142,6 +142,22 @@ PopupMenuAction.prototype.updateMenuStates = function () { } } + // Update the radio buttons for font, in case they were updated using the larger + // smaller font menu items + + var rbs = this.domNode.querySelectorAll('[role=menuitemradio]'); + + for (var i = 0; i < rbs.length; i++) { + var rb = rbs[i]; + + if(this.actionManager.fontSize === rb.textContent.toLowerCase()) { + rb.setAttribute('aria-checked', 'true'); + } + else { + rb.setAttribute('aria-checked', 'false'); + } + } + }; /* EVENT HANDLERS */ diff --git a/examples/menubar/menubar-2/js/PopupMenuItemAction.js b/examples/menubar/menubar-2/js/PopupMenuItemAction.js index 02a77d2985..24dc1c7762 100644 --- a/examples/menubar/menubar-2/js/PopupMenuItemAction.js +++ b/examples/menubar/menubar-2/js/PopupMenuItemAction.js @@ -76,23 +76,6 @@ MenuItem.prototype.activateMenuitem = function (node) { if (role === 'menuitem') { this.menu.actionManager.setOption(option, value); - - if (option === 'font-smaller' || option === 'font-larger') { - - var rbs = node.parentNode.querySelectorAll('[role=menuitemradio]'); - - for (var i = 0; i < rbs.length; i++) { - var rb = rbs[i]; - - if(this.menu.actionManager.fontSize === rb.textContent.toLowerCase()) { - rb.setAttribute('aria-checked', 'true'); - } - else { - rb.setAttribute('aria-checked', 'false'); - } - } - } - } else { if (role === 'menuitemcheckbox') { diff --git a/examples/menubar/menubar-2/menubar-2.html b/examples/menubar/menubar-2/menubar-2.html index d269319213..266e2fa287 100644 --- a/examples/menubar/menubar-2/menubar-2.html +++ b/examples/menubar/menubar-2/menubar-2.html @@ -90,8 +90,8 @@

Example