unscroll
Advanced tools
Comparing version 1.0.2 to 1.0.3
{ | ||
"name": "unscroll", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Make your page unscrollable and adjusts content elements to compensate for the missing scrollbar.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -33,3 +33,3 @@ // UMD wrapper from https://github.com/umdjs/umd | ||
} | ||
const scrollElement = document.createElement('div'); | ||
var scrollElement = document.createElement('div'); | ||
scrollElement.style.width = '100px'; | ||
@@ -103,3 +103,3 @@ scrollElement.style.height = '100px'; | ||
for (var i = 0; i < elements.length; i++) { | ||
const elementsDOM = document.querySelectorAll(elements[i][0]); | ||
var elementsDOM = document.querySelectorAll(elements[i][0]); | ||
for (var j = 0; j < elementsDOM.length; j++) { | ||
@@ -110,4 +110,4 @@ if (elementsDOM[j].getAttribute('data-unscroll')) { | ||
var attribute = elements[i][1]; | ||
const computedStyles = window.getComputedStyle(elementsDOM[j]); | ||
const computedStyle = computedStyles.getPropertyValue(attribute); | ||
var computedStyles = window.getComputedStyle(elementsDOM[j]); | ||
var computedStyle = computedStyles.getPropertyValue(attribute); | ||
elementsDOM[j].setAttribute('data-unscroll', attribute); | ||
@@ -117,3 +117,3 @@ if (!computedStyle) { | ||
} | ||
const operator = attribute == 'padding-right' || attribute == 'right' ? '+' : '-'; | ||
var operator = attribute == 'padding-right' || attribute == 'right' ? '+' : '-'; | ||
elementsDOM[j].style[attribute] = 'calc(' + computedStyle + ' ' + operator + ' ' + this.getScrollbarWidth() + ')'; | ||
@@ -120,0 +120,0 @@ } |
8973