Added ability to close menu when a child element has closeMenu directive

This commit is contained in:
TheHollidayInn
2015-08-26 15:32:59 -05:00
parent 049f9280a2
commit 6fb29d8766
5 changed files with 54 additions and 31 deletions

View File

@@ -11,7 +11,10 @@
restrict: 'A',
link: function($scope, element, attrs) {
element.on('click', function(event) {
$scope._expandedMenu = null;
if ( $scope.$parent._expandedMenu ) {
$scope.$parent._expandedMenu.menu = null;
}
$scope._expandedMenu.menu = null;
$scope.$apply()
});
}