Skip to content

Commit

Permalink
fix(menus): Switching applyAsync for timeout.
Browse files Browse the repository at this point in the history
Reverting my previous change.

fix #6533
  • Loading branch information
Portugal, Marcelo authored and mportuga committed Jan 17, 2018
1 parent 01dee3c commit 136335f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/js/core/directives/ui-grid-column-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -436,9 +436,9 @@ function ($timeout, gridUtil, uiGridConstants, uiGridColumnMenuService, $documen
$scope.hideMenu();
};

//Since we are hiding this column the default hide action will fail so we need to focus somewhere else.
// Since we are hiding this column the default hide action will fail so we need to focus somewhere else.
var setFocusOnHideColumn = function(){
$scope.$applyAsync(function() {
$timeout(function() {
// Get the UID of the first
var focusToGridMenu = function(){
return gridUtil.focus.byId('grid-menu', $scope.grid);
Expand Down
3 changes: 2 additions & 1 deletion src/js/core/directives/ui-grid-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ function ($compile, $timeout, $window, $document, gridUtil, uiGridConstants, i18
*/
$scope.shown = true;

$scope.$applyAsync(function() {
// Must be a timeout in order to work properly in Firefox. Issue #6533
$timeout(function() {
$scope.shownMid = true;
$scope.$emit('menu-shown');
});
Expand Down

0 comments on commit 136335f

Please sign in to comment.