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

Commit 667a05f

Browse files
committed
fix(menu): all menus no longer self destruct when one is destroyed
closes #5395
1 parent 3ab6aa3 commit 667a05f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/menu/js/menuController.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ angular
77
/**
88
* @ngInject
99
*/
10-
function MenuController($mdMenu, $attrs, $element, $scope, $mdUtil, $timeout, $rootScope) {
10+
function MenuController($mdMenu, $attrs, $element, $scope, $mdUtil, $timeout, $rootScope, $q) {
1111

1212
var menuContainer;
1313
var self = this;
@@ -149,7 +149,7 @@ function MenuController($mdMenu, $attrs, $element, $scope, $mdUtil, $timeout, $r
149149
};
150150

151151
this.destroy = function() {
152-
return $mdMenu.destroy();
152+
return self.isOpen ? $mdMenu.destroy() : $q.when(false);
153153
};
154154

155155
// Use the $mdMenu interim element service to close the menu contents

0 commit comments

Comments
 (0)