Skip to content

Commit

Permalink
fix(core): Adding back digest triggers when using $timeout
Browse files Browse the repository at this point in the history
This reverts commit 7e25a9b.

5895
  • Loading branch information
Portugal, Marcelo authored and Portugal, Marcelo committed Dec 15, 2016
1 parent 441613f commit d882087
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/js/core/directives/ui-grid.js
Expand Up @@ -241,7 +241,7 @@ function uiGridDirective($compile, $templateCache, $timeout, $window, gridUtil,
sizeChecks++;
}
else {
$timeout(init, 0, false);
$timeout(init);
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/js/core/factories/Grid.js
Expand Up @@ -2244,13 +2244,13 @@ angular.module('ui.grid')
}

p.resolve();
}, 0, false);
});
}
else {
// Timeout still needs to be here to trigger digest after styles have been rebuilt
$timeout(function() {
p.resolve();
}, 0, false);
});
}

return p.promise;
Expand Down
8 changes: 4 additions & 4 deletions src/js/core/services/ui-grid-util.js
Expand Up @@ -831,7 +831,7 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
} else {
s.logWarn('[focus.byId] Element id ' + elementID + ' was not found.');
}
}, 0, false);
});
this.queue.push(promise);
return promise;
},
Expand All @@ -856,7 +856,7 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
if (element){
element[0].focus();
}
}, 0, false);
});
this.queue.push(promise);
return promise;
},
Expand Down Expand Up @@ -886,8 +886,8 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
};
this._purgeQueue();
if (aSync){ //Do this asynchronysly
var promise = $timeout(focusBySelector, 0, false);
this.queue.push($timeout(focusBySelector), 0, false);
var promise = $timeout(focusBySelector);
this.queue.push($timeout(focusBySelector));
return promise;
} else {
return focusBySelector();
Expand Down

0 comments on commit d882087

Please sign in to comment.