Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
81159 views
1
/**
2
* Copyright 2013-2014, Facebook, Inc.
3
* All rights reserved.
4
*
5
* This source code is licensed under the BSD-style license found in the
6
* LICENSE file in the root directory of this source tree. An additional grant
7
* of patent rights can be found in the PATENTS file in the same directory.
8
*
9
* @providesModule ViewportMetrics
10
*/
11
12
"use strict";
13
14
var getUnboundedScrollPosition = require('getUnboundedScrollPosition');
15
16
var ViewportMetrics = {
17
18
currentScrollLeft: 0,
19
20
currentScrollTop: 0,
21
22
refreshScrollValues: function() {
23
var scrollPosition = getUnboundedScrollPosition(window);
24
ViewportMetrics.currentScrollLeft = scrollPosition.x;
25
ViewportMetrics.currentScrollTop = scrollPosition.y;
26
}
27
28
};
29
30
module.exports = ViewportMetrics;
31
32