Skip to content

Commit

Permalink
Fix for issue #4 Flashing and jumping menus in Firefox
Browse files Browse the repository at this point in the history
DOMAttrModified event handler, which was added to provide support for
the way Windows 8 Narrator expands and collapses elements using the
aria-expanded attribute, wasn't getting removed properly.
  • Loading branch information
majornista committed Oct 10, 2013
1 parent 71bfe6f commit 0b4fdd7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/jquery-accessibleMegaMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,7 @@ limitations under the License.

_toggleExpandedEventHandlers.call(this, hide);
$('html').off('mouseup.outside-accessible-megamenu, touchend.outside-accessible-megamenu, mspointerup.outside-accessible-megamenu, pointerup.outside-accessible-megamenu', _clickOutsideHandler);

menu.find('.' + settings.panelClass).off('DOMAttrModified.accessible-megamenu', _DOMAttrModifiedHandler);
menu.find('[aria-expanded].' + this.settings.panelClass).off('DOMAttrModified.accessible-megamenu');

if (hide) {
topli = menu.find('.' + settings.topNavItemClass + ' .' + settings.openClass + ':first').closest('.' + settings.topNavItemClass);
Expand All @@ -241,6 +240,7 @@ limitations under the License.
if ((event.type === 'keydown' && event.keyCode === Keyboard.ESCAPE) || event.type === 'DOMAttrModified') {
newfocus = topli.find(':tabbable:first');
setTimeout(function () {
menu.find('[aria-expanded].' + that.settings.panelClass).off('DOMAttrModified.accessible-megamenu');
newfocus.focus();
that.justFocused = false;
}, 99);
Expand Down Expand Up @@ -660,7 +660,7 @@ limitations under the License.
if (hide) {
$('html').off('mouseup.outside-accessible-megamenu, touchend.outside-accessible-megamenu, mspointerup.outside-accessible-megamenu, pointerup.outside-accessible-megamenu', _clickOutsideHandler);

menu.find('.' + this.settings.panelClass).on('DOMAttrModified.accessible-megamenu', _DOMAttrModifiedHandler.bind(this));
menu.find('[aria-expanded].' + this.settings.panelClass).off('DOMAttrModified.accessible-megamenu', _DOMAttrModifiedHandler);
} else {
$('html').on('mouseup.outside-accessible-megamenu, touchend.outside-accessible-megamenu, mspointerup.outside-accessible-megamenu, pointerup.outside-accessible-megamenu', _clickOutsideHandler.bind(this));

Expand Down

0 comments on commit 0b4fdd7

Please sign in to comment.