Skip to content

Commit

Permalink
fix(core): add false flag to $timeout and $interval to prevent $apply
Browse files Browse the repository at this point in the history
Nice increase in scrolling performance when using mousewheel or trackpad
  • Loading branch information
swalters committed Jan 28, 2016
1 parent 60fe84b commit 4ba2820
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/js/core/services/ui-grid-util.js
Expand Up @@ -21,7 +21,7 @@ if (typeof Function.prototype.bind !== "function") {
};
}

function getStyles (elem) {
function getStyles (elem) {
var e = elem;
if (typeof(e.length) !== 'undefined' && e.length) {
e = elem[0];
Expand Down Expand Up @@ -1175,7 +1175,7 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
if (timeout) {
$timeout.cancel(timeout);
}
timeout = $timeout(later, wait);
timeout = $timeout(later, wait, false);
if (callNow) {
result = func.apply(context, args);
}
Expand Down Expand Up @@ -1225,7 +1225,7 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
function runFunc(endDate){
lastCall = +new Date();
func.apply(context, args);
$interval(function(){ queued = null; }, 0, 1);
$interval(function(){ queued = null; }, 0, 1, false);
}

return function(){
Expand All @@ -1238,7 +1238,7 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
runFunc();
}
else if (options.trailing){
queued = $interval(runFunc, wait - sinceLast, 1);
queued = $interval(runFunc, wait - sinceLast, 1, false);
}
}
};
Expand Down

0 comments on commit 4ba2820

Please sign in to comment.