diff options
author | Iftekharul Islam <iffy.ryan@ibm.com> | 2018-02-08 13:58:10 -0600 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-03-14 18:51:43 +0000 |
commit | f74f8a066afb18532cdbcc33319fff242ce0ed0c (patch) | |
tree | 8705a07c49d4845d9af1a85724d9e1d086d0e686 | |
parent | a00b8164353ef286b321db3c783edc73c01567ba (diff) | |
download | phosphor-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.js | 15 |
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); |