get-scroll-info
Advanced tools
Comparing version 0.1.11 to 0.2.0
@@ -8,3 +8,3 @@ "use strict"; | ||
}); | ||
exports.getScrollNode = exports.default = void 0; | ||
exports.getScrollNode = exports["default"] = void 0; | ||
@@ -27,3 +27,3 @@ var _typeof2 = _interopRequireDefault(require("reshow-runtime/helpers/typeof")); | ||
oWin = (0, _winDoc.win)(); | ||
isWebkit = _reshowConstant.UNDEFINED !== (0, _typeof2.default)(oDoc.webkitIsFullScreen); | ||
isWebkit = _reshowConstant.UNDEFINED !== (0, _typeof2["default"])(oDoc.webkitIsFullScreen); | ||
docEl = oDoc.documentElement; | ||
@@ -48,3 +48,3 @@ }; | ||
if (!el.id) { | ||
el.id = 'scroll-info-' + domCount; | ||
el.id = "scroll-info-" + domCount; | ||
domCount++; | ||
@@ -67,4 +67,4 @@ } | ||
var h; | ||
var nodeName = (el.nodeName || '').toLowerCase(); | ||
var isRoot = 'body' === nodeName || 'html' === nodeName; | ||
var nodeName = (el.nodeName || "").toLowerCase(); | ||
var isRoot = "body" === nodeName || "html" === nodeName; | ||
@@ -101,4 +101,4 @@ if (isRoot) { | ||
top: scrollTop, | ||
right: scrollRight, | ||
bottom: scrollBottom, | ||
right: w > scrollWidth ? scrollWidth : scrollRight, | ||
bottom: h > scrollHeight ? scrollHeight : scrollBottom, | ||
left: scrollLeft | ||
@@ -111,2 +111,2 @@ }; | ||
var _default = getScrollInfo; | ||
exports.default = _default; | ||
exports["default"] = _default; |
import _typeof from "reshow-runtime/es/helpers/typeof"; | ||
import { doc, win } from 'win-doc'; | ||
import { UNDEFINED } from 'reshow-constant'; | ||
import { doc, win } from "win-doc"; | ||
import { UNDEFINED } from "reshow-constant"; | ||
var lastScrollStore = {}; | ||
@@ -34,3 +34,3 @@ var oDoc; | ||
if (!el.id) { | ||
el.id = 'scroll-info-' + domCount; | ||
el.id = "scroll-info-" + domCount; | ||
domCount++; | ||
@@ -51,4 +51,4 @@ } | ||
var h; | ||
var nodeName = (el.nodeName || '').toLowerCase(); | ||
var isRoot = 'body' === nodeName || 'html' === nodeName; | ||
var nodeName = (el.nodeName || "").toLowerCase(); | ||
var isRoot = "body" === nodeName || "html" === nodeName; | ||
@@ -85,4 +85,4 @@ if (isRoot) { | ||
top: scrollTop, | ||
right: scrollRight, | ||
bottom: scrollBottom, | ||
right: w > scrollWidth ? scrollWidth : scrollRight, | ||
bottom: h > scrollHeight ? scrollHeight : scrollBottom, | ||
left: scrollLeft | ||
@@ -89,0 +89,0 @@ }; |
{ | ||
"name": "get-scroll-info", | ||
"version": "0.1.11", | ||
"version": "0.2.0", | ||
"description": "Get Scroll Information", | ||
@@ -19,11 +19,14 @@ "repository": "react-atomic/react-atomic-organism", | ||
"chai": "*", | ||
"jsdom": "*", | ||
"jsdom-global": "*", | ||
"mocha": "*" | ||
}, | ||
"scripts": { | ||
"clean": "find ./build -name '*.*' | xargs rm -rf", | ||
"build:cjs": "BABEL_ENV=build babel src -d build/cjs/src --root-mode upward", | ||
"build:es": "BABEL_ENV=es babel src -d build/es/src --root-mode upward", | ||
"build:test": "BABEL_ENV=build babel tests -d build/tests --root-mode upward", | ||
"build": "rm -rf build && npm run build:cjs && npm run build:es", | ||
"prepublishOnly": "npm run build", | ||
"test": "npm run build && npm run build:test && mocha 'build/tests/**/*.js'" | ||
"build": "npm run clean && npm run build:cjs && npm run build:es", | ||
"prepublishOnly": "npm run test", | ||
"mocha": "mocha -r jsdom-global/register 'build/cjs/**/__tests__/*.js'", | ||
"test": "npm run build && npm run mocha" | ||
}, | ||
@@ -30,0 +33,0 @@ "files": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7452
6
215
5