Skip to content

Commit

Permalink
fixed bug for italic style menu button and for larger and samller fon…
Browse files Browse the repository at this point in the history
…t not updating the list of menubuttonradio items in the same menu
  • Loading branch information
jongund committed Aug 28, 2017
1 parent 0300f09 commit b687462
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions examples/menubar/menubar-2/js/PopupMenuItemAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,23 @@ 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') {
Expand Down
2 changes: 1 addition & 1 deletion examples/menubar/menubar-2/js/styleManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ StyleManager.prototype.setItalic = function (flag) {
this.node.style.fontStyle = 'italic';
}
else {
this.node.style.fontStyle = 'none';
this.node.style.fontStyle = 'normal';
}
};

Expand Down

0 comments on commit b687462

Please sign in to comment.