avoid reading the scroll position twice
Fabio M. Costa committed
Oct 20, 2014 at 13:30 UTC
dafaf1a42efdc8cce28f522a05b771123e6b2bf6
1 file changed
+1
-4
src/browser/ui/dom/ViewportMetrics.js
+1
-4
@@ -11,16 +11,13 @@
11
12
"use strict";
13
14
-var getUnboundedScrollPosition = require('getUnboundedScrollPosition');
15
-
14
var ViewportMetrics = {
15
16
currentScrollLeft: 0,
17
18
currentScrollTop: 0,
19
22
- refreshScrollValues: function() {
23
- var scrollPosition = getUnboundedScrollPosition(window);
20
+ refreshScrollValues: function(scrollPosition) {
21
ViewportMetrics.currentScrollLeft = scrollPosition.x;
22
ViewportMetrics.currentScrollTop = scrollPosition.y;
23
}