Skip to content

Commit

Permalink
fix(uiGridMenu): Only run applyHide when not shown
Browse files Browse the repository at this point in the history
applyHide() was running on all GRID_SCROLL events, whether or not the menu
was visible. This was causing excess $digest() loops.
  • Loading branch information
c0bra committed Nov 13, 2014
1 parent 79f6c21 commit 91bf06f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/js/core/directives/ui-grid-menu.js
Expand Up @@ -123,9 +123,11 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants) {

// *** Auto hide when click elsewhere ******
var applyHideMenu = function(){
$scope.$apply(function () {
$scope.hideMenu();
});
if ($scope.shown) {
$scope.$apply(function () {
$scope.hideMenu();
});
}
};

if (typeof($scope.autoHide) === 'undefined' || $scope.autoHide === undefined) {
Expand Down

0 comments on commit 91bf06f

Please sign in to comment.