Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

get-scroll-info

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-scroll-info - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

4

build/cjs/src/__tests__/testGetScrollInfo.js

@@ -25,4 +25,4 @@ "use strict";

top: 0,
right: 0,
bottom: 0,
right: 1024,
bottom: 768,
left: 0

@@ -29,0 +29,0 @@ });

@@ -65,7 +65,21 @@ "use strict";

var nodeName = (el.nodeName || "").toLowerCase();
var isRoot = "body" === nodeName || "html" === nodeName;
var isRoot = "body" === nodeName || "html" === nodeName; // defined scrollWidth and scrollHeight first.
// to know if have vertical or horizontal bar.
var scrollWidth = el.scrollWidth;
var scrollHeight = el.scrollHeight;
if (isRoot) {
w = Math.max(docEl.clientWidth || 0, oWin.innerWidth || 0);
h = Math.max(docEl.clientHeight || 0, oWin.innerHeight || 0);
w = Math.max(el.clientWidth || 0, oWin.innerWidth || 0);
h = Math.max(el.clientHeight || 0, oWin.innerHeight || 0);
var hasHorizontalBar = w < scrollWidth;
var hasVerticalBar = h < scrollHeight;
if (hasHorizontalBar) {
h = el.clientHeight;
}
if (hasVerticalBar) {
w = el.clientWidth;
}
} else {

@@ -77,5 +91,3 @@ w = el.clientWidth;

var scrollLeft = el.scrollLeft;
var scrollHeight = el.scrollHeight;
var scrollTop = el.scrollTop;
var scrollWidth = el.scrollWidth;
var scrollBottom = scrollTop + h;

@@ -99,4 +111,4 @@ var scrollRight = scrollLeft + w;

top: scrollTop,
right: w > scrollWidth ? scrollWidth : scrollRight,
bottom: h > scrollHeight ? scrollHeight : scrollBottom,
right: scrollRight,
bottom: scrollBottom,
left: scrollLeft

@@ -103,0 +115,0 @@ };

@@ -19,4 +19,4 @@ import { expect } from "chai";

top: 0,
right: 0,
bottom: 0,
right: 1024,
bottom: 768,
left: 0

@@ -23,0 +23,0 @@ });

@@ -51,7 +51,21 @@ import _typeof from "reshow-runtime/es/helpers/typeof";

var nodeName = (el.nodeName || "").toLowerCase();
var isRoot = "body" === nodeName || "html" === nodeName;
var isRoot = "body" === nodeName || "html" === nodeName; // defined scrollWidth and scrollHeight first.
// to know if have vertical or horizontal bar.
var scrollWidth = el.scrollWidth;
var scrollHeight = el.scrollHeight;
if (isRoot) {
w = Math.max(docEl.clientWidth || 0, oWin.innerWidth || 0);
h = Math.max(docEl.clientHeight || 0, oWin.innerHeight || 0);
w = Math.max(el.clientWidth || 0, oWin.innerWidth || 0);
h = Math.max(el.clientHeight || 0, oWin.innerHeight || 0);
var hasHorizontalBar = w < scrollWidth;
var hasVerticalBar = h < scrollHeight;
if (hasHorizontalBar) {
h = el.clientHeight;
}
if (hasVerticalBar) {
w = el.clientWidth;
}
} else {

@@ -63,5 +77,3 @@ w = el.clientWidth;

var scrollLeft = el.scrollLeft;
var scrollHeight = el.scrollHeight;
var scrollTop = el.scrollTop;
var scrollWidth = el.scrollWidth;
var scrollBottom = scrollTop + h;

@@ -85,4 +97,4 @@ var scrollRight = scrollLeft + w;

top: scrollTop,
right: w > scrollWidth ? scrollWidth : scrollRight,
bottom: h > scrollHeight ? scrollHeight : scrollBottom,
right: scrollRight,
bottom: scrollBottom,
left: scrollLeft

@@ -89,0 +101,0 @@ };

{
"name": "get-scroll-info",
"version": "0.2.0",
"version": "0.2.1",
"description": "Get Scroll Information",

@@ -5,0 +5,0 @@ "repository": "react-atomic/react-atomic-organism",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc