summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIftekharul Islam <iffy.ryan@ibm.com>2018-02-08 13:58:10 -0600
committerBrad Bishop <bradleyb@fuzziesquirrel.com>2018-03-14 18:51:43 +0000
commitf74f8a066afb18532cdbcc33319fff242ce0ed0c (patch)
tree8705a07c49d4845d9af1a85724d9e1d086d0e686
parenta00b8164353ef286b321db3c783edc73c01567ba (diff)
downloadphosphor-webui-f74f8a066afb18532cdbcc33319fff242ce0ed0c.tar.gz
phosphor-webui-f74f8a066afb18532cdbcc33319fff242ce0ed0c.zip
Fixing the submenu closing issue
fixes openbmc/openbmc#2743 Change-Id: I1fc43603dd99e562de6cd053c720b3e4169edb2a Signed-off-by: Iftekharul Islam <iffy.ryan@ibm.com>
-rw-r--r--app/common/directives/app-navigation.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/app/common/directives/app-navigation.js b/app/common/directives/app-navigation.js
index 2b7ad32..02d3f2d 100644
--- a/app/common/directives/app-navigation.js
+++ b/app/common/directives/app-navigation.js
@@ -49,7 +49,20 @@ window.angular && (function (angular) {
dataService.bodyStyle = {'padding-top': paddingTop + 'px'};
$scope.navStyle = {'top': paddingTop + 'px'};
});
- }]
+ }],
+ link: function(scope, element, attributes) {
+ var rawNavElement = angular.element(element)[0];
+ angular.element(window.document).bind('click', function(event){
+ if (rawNavElement.contains(event.target))
+ return;
+
+ if(scope.showSubMenu){
+ scope.$apply(function(){
+ scope.showSubMenu = false;
+ });
+ }
+ });
+ }
};
});
})(window.angular);
OpenPOWER on IntegriCloud