Socket
Socket
Sign inDemoInstall

js-viewport-utils

Package Overview
Dependencies
38
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.2 to 2.0.3

4

changelog.md

@@ -26,1 +26,5 @@ #1.0.0

* Refactor
#2.0.3
* Refactor

21

dist/js-viewport-utils.es5.js

@@ -36,3 +36,3 @@ /*! *****************************************************************************

var jsViewportDefaults = {
container: typeof document !== "undefined" ? document.body : window,
container: document.body || window,
sides: [JsViewportSides.ALL],

@@ -55,3 +55,3 @@ top: 0,

// IE 8 and lower fail this
var canUseWindowDimensions = typeof window !== "undefined" && window.innerHeight !== undefined;
var canUseWindowDimensions = window && typeof window.innerHeight === typeof 0;
var viewportUtils = {

@@ -85,3 +85,3 @@ /**

// Extract the DOM node from a jQuery collection
if (!!options && !!options.container && options.container.jquery) {
if (options && options.container && options.container.jquery) {
options.container = options.container.get(0);

@@ -109,8 +109,4 @@ }

_a[JsViewportSides.RIGHT] = function () {
if (isWindow) {
return (elemBoundingRect.right <= (containerBoundingRect.right + containerScrollLeft) - config.right);
}
else {
return (elemBoundingRect.right <= containerBoundingRect.right - scrollBarWidths[0] - config.right);
}
var ctScroll = isWindow ? containerScrollLeft : -scrollBarWidths[0];
return elemBoundingRect.right <= (containerBoundingRect.right + ctScroll - config.right);
},

@@ -163,8 +159,7 @@ _a[JsViewportSides.BOTTOM] = function () {

// Loop through all of the sides
var sides = config.sides;
i = sides.length;
i = config.sides.length;
while (i--) {
// Test the element against each side of the viewport that was requested
if (sidesRegex.test(sides[i])) {
if (isSideIn[sides[i]]()) {
if (sidesRegex.test(config.sides[i])) {
if (isSideIn[config.sides[i]]()) {
result = !0;

@@ -171,0 +166,0 @@ }

@@ -41,3 +41,3 @@ (function (global, factory) {

var jsViewportDefaults = {
container: typeof document !== "undefined" ? document.body : window,
container: document.body || window,
sides: [exports.JsViewportSides.ALL],

@@ -60,3 +60,3 @@ top: 0,

// IE 8 and lower fail this
var canUseWindowDimensions = typeof window !== "undefined" && window.innerHeight !== undefined;
var canUseWindowDimensions = window && typeof window.innerHeight === typeof 0;
var viewportUtils = {

@@ -90,3 +90,3 @@ /**

// Extract the DOM node from a jQuery collection
if (!!options && !!options.container && options.container.jquery) {
if (options && options.container && options.container.jquery) {
options.container = options.container.get(0);

@@ -114,8 +114,4 @@ }

_a[exports.JsViewportSides.RIGHT] = function () {
if (isWindow) {
return (elemBoundingRect.right <= (containerBoundingRect.right + containerScrollLeft) - config.right);
}
else {
return (elemBoundingRect.right <= containerBoundingRect.right - scrollBarWidths[0] - config.right);
}
var ctScroll = isWindow ? containerScrollLeft : -scrollBarWidths[0];
return elemBoundingRect.right <= (containerBoundingRect.right + ctScroll - config.right);
},

@@ -168,8 +164,7 @@ _a[exports.JsViewportSides.BOTTOM] = function () {

// Loop through all of the sides
var sides = config.sides;
i = sides.length;
i = config.sides.length;
while (i--) {
// Test the element against each side of the viewport that was requested
if (sidesRegex.test(sides[i])) {
if (isSideIn[sides[i]]()) {
if (sidesRegex.test(config.sides[i])) {
if (isSideIn[config.sides[i]]()) {
result = !0;

@@ -176,0 +171,0 @@ }

{
"name": "js-viewport-utils",
"version": "2.0.2",
"version": "2.0.3",
"description": "A set of viewport utils",

@@ -124,6 +124,3 @@ "repository": {

"ts-node": "~7.0.1",
"tslint": "~5.11.0",
"tslint-config-prettier": "~1.15.0",
"tslint-config-standard": "~8.0.1",
"tslint-consistent-codestyle": "~1.16.0",
"tslint": "~6.1.3",
"typedoc": "~0.12.0",

@@ -130,0 +127,0 @@ "typescript": "~3.0.3",

@@ -1,2 +0,2 @@

# JS Viewport Utils 2.0.2
# JS Viewport Utils 2.0.3

@@ -3,0 +3,0 @@ Includes:

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc