Skip to content

Commit 4ba2820

Browse files
committed
fix(core): add false flag to $timeout and $interval to prevent $apply
Nice increase in scrolling performance when using mousewheel or trackpad
1 parent 60fe84b commit 4ba2820

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/js/core/services/ui-grid-util.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if (typeof Function.prototype.bind !== "function") {
2121
};
2222
}
2323

24-
function getStyles (elem) {
24+
function getStyles (elem) {
2525
var e = elem;
2626
if (typeof(e.length) !== 'undefined' && e.length) {
2727
e = elem[0];
@@ -1175,7 +1175,7 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
11751175
if (timeout) {
11761176
$timeout.cancel(timeout);
11771177
}
1178-
timeout = $timeout(later, wait);
1178+
timeout = $timeout(later, wait, false);
11791179
if (callNow) {
11801180
result = func.apply(context, args);
11811181
}
@@ -1225,7 +1225,7 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
12251225
function runFunc(endDate){
12261226
lastCall = +new Date();
12271227
func.apply(context, args);
1228-
$interval(function(){ queued = null; }, 0, 1);
1228+
$interval(function(){ queued = null; }, 0, 1, false);
12291229
}
12301230

12311231
return function(){
@@ -1238,7 +1238,7 @@ module.service('gridUtil', ['$log', '$window', '$document', '$http', '$templateC
12381238
runFunc();
12391239
}
12401240
else if (options.trailing){
1241-
queued = $interval(runFunc, wait - sinceLast, 1);
1241+
queued = $interval(runFunc, wait - sinceLast, 1, false);
12421242
}
12431243
}
12441244
};

0 commit comments

Comments
 (0)