Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

Commit

Permalink
fix(menu): resolve an error when going from a nested menu item to a r…
Browse files Browse the repository at this point in the history
…egular one

Fixes a JS error that was being thrown if the user goes from a menu item with a sub menu to an item that doesn't have one.
Also fixes the menu item without a sub menu staying highlighted afterwards.

Closes #7819.

Closes #7826
  • Loading branch information
crisbeto authored and ThomasBurleson committed Apr 3, 2016
1 parent 7988cf6 commit e3fc728
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/components/menu/js/menuController.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ function MenuController($mdMenu, $attrs, $element, $scope, $mdUtil, $timeout, $r
if (self.currentlyOpenMenu && self.currentlyOpenMenu != nestedMenu) {
var closeTo = self.nestLevel + 1;
self.currentlyOpenMenu.close(true, { closeTo: closeTo });
self.isAlreadyOpening = true;
nestedMenu.open();
self.isAlreadyOpening = !!nestedMenu;
nestedMenu && nestedMenu.open();
} else if (nestedMenu && !nestedMenu.isOpen && nestedMenu.open) {
self.isAlreadyOpening = true;
nestedMenu.open();
self.isAlreadyOpening = !!nestedMenu;
nestedMenu && nestedMenu.open();
}
}, nestedMenu ? 100 : 250);
var focusableTarget = event.currentTarget.querySelector('.md-button:not([disabled])');
Expand Down

0 comments on commit e3fc728

Please sign in to comment.