@borngroup/born-utilities
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -16,2 +16,4 @@ define(['exports'], function (exports) { | ||
exports.eraseCookie = eraseCookie; | ||
exports.getTotalRect = getTotalRect; | ||
exports.scrollToPosition = scrollToPosition; | ||
@@ -240,2 +242,37 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { | ||
} | ||
/** | ||
* Adds the specified getBoundingClientRect()[`property`] from each node found in `elements`. | ||
* @return {Integer} [description] | ||
*/ | ||
function getTotalRect(elements, property) { | ||
var totalOffsetHeight = 0; | ||
callbackOnElements(elements, function (currentEl) { | ||
totalOffsetHeight += currentEl.getBoundingClientRect()[property || 'height']; | ||
}); | ||
return totalOffsetHeight; | ||
} | ||
/** | ||
* Returns the target relative to the current window scroll position. | ||
* @param {HTMLElement | HTML Selector | Number} target [Target element(s) or position value to scroll to] | ||
* @param {HTMLElement | NodeList | HTML Selector | Number} offset [Offset element to calculate the height from, or offset value to substract] | ||
*/ | ||
function scrollToPosition(target) { | ||
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; | ||
var documentHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight), | ||
documentScrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop, | ||
windowHeight = document.documentElement.clientHeight, | ||
totalOffset = typeof offset === 'number' ? offset : getTotalRect(offset), | ||
targetOffset = typeof target === 'number' ? target : getTotalRect(target, 'top') + documentScrollTop, | ||
targetOffsetToScroll = Math.round(documentHeight - targetOffset < windowHeight ? documentHeight - windowHeight : targetOffset); | ||
//Remove manual offset from target position. | ||
targetOffsetToScroll -= totalOffset; | ||
return targetOffsetToScroll; | ||
} | ||
}); |
@@ -1,1 +0,1 @@ | ||
define(["exports"],function(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.isRTL=isRTL;exports.whichTransition=whichTransition;exports.createElWithAttrs=createElWithAttrs;exports.callbackOnElements=callbackOnElements;exports.getUrlParameter=getUrlParameter;exports.hasURLParameter=hasURLParameter;exports.createCookie=createCookie;exports.readCookie=readCookie;exports.eraseCookie=eraseCookie;var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};(function(){if(!Element.prototype.matches){Element.prototype.matches=Element.prototype.msMatchesSelector}if(!Element.prototype.closest){Element.prototype.closest=_getClosest}})();function _getClosest(selector){var currentEl=this;while(currentEl.constructor!==HTMLHtmlElement){if(currentEl.parentNode.matches(selector)){return currentEl.parentNode}else if(currentEl.matches(selector)){return currentEl}currentEl=currentEl.parentNode}return false}var isMobile=exports.isMobile={Android:function Android(){return navigator.userAgent.match(/Android/i)},BlackBerry:function BlackBerry(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function iOS(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function Opera(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function Windows(){return navigator.userAgent.match(/IEMobile/i)||navigator.userAgent.match(/WPDesktop/i)},any:function any(){return isMobile.Android()||isMobile.BlackBerry()||isMobile.iOS()||isMobile.Opera()||isMobile.Windows()}};function isRTL(){return document.documentElement.getAttribute("dir")==="rtl"?true:false}function whichTransition(){var dummyEl=document.createElement("dummy"),transitions={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(var key in transitions){if(dummyEl.style[key]!==undefined){return transitions[key]}}}function createElWithAttrs(appendTarget,attributes,type){var el=void 0;if((typeof type==="undefined"?"undefined":_typeof(type))==="object"){var fullNameSpace=type.nameSpace==="svg"?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml";el=document.createElementNS(fullNameSpace,type.tagName||"div")}else{el=document.createElement(type||"div")}for(var key in attributes){el.setAttribute(key,attributes[key])}if(appendTarget){appendTarget.appendChild(el)}return el}function callbackOnElements(elementSelector,callback){var elementList=void 0;if(elementSelector.length){if(typeof elementSelector==="string"){elementList=document.querySelectorAll(elementSelector)}else{elementList=elementSelector}[].forEach.call(elementList,callback.bind(this))}else{callback.call(this,elementSelector)}}function getUrlParameter(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regex=new RegExp("[\\?&]"+name+"=([^&#]*)"),results=regex.exec(location.search);return results===null?"":decodeURIComponent(results[1].replace(/\+/g," "))}function hasURLParameter(name){var regex=new RegExp("[?&]"+name);return"#"+name===window.location.hash||regex.test(window.location.search)}function createCookie(name,value,days){var expires;if(days){var date=new Date;date.setTime(date.getTime()+days*24*60*60*1e3);expires="; expires="+date.toGMTString()}else{expires=""}document.cookie=name+"="+value+expires+"; path=/"}function readCookie(name){var nameEQ=name+"=",cookieList=document.cookie.split(";");for(var i=0;i<cookieList.length;i++){var currentCookie=cookieList[i];while(currentCookie.charAt(0)==" "){currentCookie=currentCookie.substring(1,currentCookie.length)}if(currentCookie.indexOf(nameEQ)===0){return currentCookie.substring(nameEQ.length,currentCookie.length)}}return null}function eraseCookie(name){createCookie(name,"",-1)}}); | ||
define(["exports"],function(exports){"use strict";Object.defineProperty(exports,"__esModule",{value:true});exports.isRTL=isRTL;exports.whichTransition=whichTransition;exports.createElWithAttrs=createElWithAttrs;exports.callbackOnElements=callbackOnElements;exports.getUrlParameter=getUrlParameter;exports.hasURLParameter=hasURLParameter;exports.createCookie=createCookie;exports.readCookie=readCookie;exports.eraseCookie=eraseCookie;exports.getTotalRect=getTotalRect;exports.scrollToPosition=scrollToPosition;var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};(function(){if(!Element.prototype.matches){Element.prototype.matches=Element.prototype.msMatchesSelector}if(!Element.prototype.closest){Element.prototype.closest=_getClosest}})();function _getClosest(selector){var currentEl=this;while(currentEl.constructor!==HTMLHtmlElement){if(currentEl.parentNode.matches(selector)){return currentEl.parentNode}else if(currentEl.matches(selector)){return currentEl}currentEl=currentEl.parentNode}return false}var isMobile=exports.isMobile={Android:function Android(){return navigator.userAgent.match(/Android/i)},BlackBerry:function BlackBerry(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function iOS(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function Opera(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function Windows(){return navigator.userAgent.match(/IEMobile/i)||navigator.userAgent.match(/WPDesktop/i)},any:function any(){return isMobile.Android()||isMobile.BlackBerry()||isMobile.iOS()||isMobile.Opera()||isMobile.Windows()}};function isRTL(){return document.documentElement.getAttribute("dir")==="rtl"?true:false}function whichTransition(){var dummyEl=document.createElement("dummy"),transitions={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(var key in transitions){if(dummyEl.style[key]!==undefined){return transitions[key]}}}function createElWithAttrs(appendTarget,attributes,type){var el=void 0;if((typeof type==="undefined"?"undefined":_typeof(type))==="object"){var fullNameSpace=type.nameSpace==="svg"?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml";el=document.createElementNS(fullNameSpace,type.tagName||"div")}else{el=document.createElement(type||"div")}for(var key in attributes){el.setAttribute(key,attributes[key])}if(appendTarget){appendTarget.appendChild(el)}return el}function callbackOnElements(elementSelector,callback){var elementList=void 0;if(elementSelector.length){if(typeof elementSelector==="string"){elementList=document.querySelectorAll(elementSelector)}else{elementList=elementSelector}[].forEach.call(elementList,callback.bind(this))}else{callback.call(this,elementSelector)}}function getUrlParameter(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regex=new RegExp("[\\?&]"+name+"=([^&#]*)"),results=regex.exec(location.search);return results===null?"":decodeURIComponent(results[1].replace(/\+/g," "))}function hasURLParameter(name){var regex=new RegExp("[?&]"+name);return"#"+name===window.location.hash||regex.test(window.location.search)}function createCookie(name,value,days){var expires;if(days){var date=new Date;date.setTime(date.getTime()+days*24*60*60*1e3);expires="; expires="+date.toGMTString()}else{expires=""}document.cookie=name+"="+value+expires+"; path=/"}function readCookie(name){var nameEQ=name+"=",cookieList=document.cookie.split(";");for(var i=0;i<cookieList.length;i++){var currentCookie=cookieList[i];while(currentCookie.charAt(0)==" "){currentCookie=currentCookie.substring(1,currentCookie.length)}if(currentCookie.indexOf(nameEQ)===0){return currentCookie.substring(nameEQ.length,currentCookie.length)}}return null}function eraseCookie(name){createCookie(name,"",-1)}function getTotalRect(elements,property){var totalOffsetHeight=0;callbackOnElements(elements,function(currentEl){totalOffsetHeight+=currentEl.getBoundingClientRect()[property||"height"]});return totalOffsetHeight}function scrollToPosition(target){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var documentHeight=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight),documentScrollTop=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,windowHeight=document.documentElement.clientHeight,totalOffset=typeof offset==="number"?offset:getTotalRect(offset),targetOffset=typeof target==="number"?target:getTotalRect(target,"top")+documentScrollTop,targetOffsetToScroll=Math.round(documentHeight-targetOffset<windowHeight?documentHeight-windowHeight:targetOffset);targetOffsetToScroll-=totalOffset;return targetOffsetToScroll}}); |
@@ -18,2 +18,4 @@ 'use strict'; | ||
exports.eraseCookie = eraseCookie; | ||
exports.getTotalRect = getTotalRect; | ||
exports.scrollToPosition = scrollToPosition; | ||
/** | ||
@@ -235,1 +237,36 @@ * [Utilities]: methods and objects that contain reusable functionality and can be called on demand. | ||
} | ||
/** | ||
* Adds the specified getBoundingClientRect()[`property`] from each node found in `elements`. | ||
* @return {Integer} [description] | ||
*/ | ||
function getTotalRect(elements, property) { | ||
var totalOffsetHeight = 0; | ||
callbackOnElements(elements, function (currentEl) { | ||
totalOffsetHeight += currentEl.getBoundingClientRect()[property || 'height']; | ||
}); | ||
return totalOffsetHeight; | ||
} | ||
/** | ||
* Returns the target relative to the current window scroll position. | ||
* @param {HTMLElement | HTML Selector | Number} target [Target element(s) or position value to scroll to] | ||
* @param {HTMLElement | NodeList | HTML Selector | Number} offset [Offset element to calculate the height from, or offset value to substract] | ||
*/ | ||
function scrollToPosition(target) { | ||
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0; | ||
var documentHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight), | ||
documentScrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop, | ||
windowHeight = document.documentElement.clientHeight, | ||
totalOffset = typeof offset === 'number' ? offset : getTotalRect(offset), | ||
targetOffset = typeof target === 'number' ? target : getTotalRect(target, 'top') + documentScrollTop, | ||
targetOffsetToScroll = Math.round(documentHeight - targetOffset < windowHeight ? documentHeight - windowHeight : targetOffset); | ||
//Remove manual offset from target position. | ||
targetOffsetToScroll -= totalOffset; | ||
return targetOffsetToScroll; | ||
} |
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};exports.isRTL=isRTL;exports.whichTransition=whichTransition;exports.createElWithAttrs=createElWithAttrs;exports.callbackOnElements=callbackOnElements;exports.getUrlParameter=getUrlParameter;exports.hasURLParameter=hasURLParameter;exports.createCookie=createCookie;exports.readCookie=readCookie;exports.eraseCookie=eraseCookie;(function(){if(!Element.prototype.matches){Element.prototype.matches=Element.prototype.msMatchesSelector}if(!Element.prototype.closest){Element.prototype.closest=_getClosest}})();function _getClosest(selector){var currentEl=this;while(currentEl.constructor!==HTMLHtmlElement){if(currentEl.parentNode.matches(selector)){return currentEl.parentNode}else if(currentEl.matches(selector)){return currentEl}currentEl=currentEl.parentNode}return false}var isMobile=exports.isMobile={Android:function Android(){return navigator.userAgent.match(/Android/i)},BlackBerry:function BlackBerry(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function iOS(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function Opera(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function Windows(){return navigator.userAgent.match(/IEMobile/i)||navigator.userAgent.match(/WPDesktop/i)},any:function any(){return isMobile.Android()||isMobile.BlackBerry()||isMobile.iOS()||isMobile.Opera()||isMobile.Windows()}};function isRTL(){return document.documentElement.getAttribute("dir")==="rtl"?true:false}function whichTransition(){var dummyEl=document.createElement("dummy"),transitions={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(var key in transitions){if(dummyEl.style[key]!==undefined){return transitions[key]}}}function createElWithAttrs(appendTarget,attributes,type){var el=void 0;if((typeof type==="undefined"?"undefined":_typeof(type))==="object"){var fullNameSpace=type.nameSpace==="svg"?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml";el=document.createElementNS(fullNameSpace,type.tagName||"div")}else{el=document.createElement(type||"div")}for(var key in attributes){el.setAttribute(key,attributes[key])}if(appendTarget){appendTarget.appendChild(el)}return el}function callbackOnElements(elementSelector,callback){var elementList=void 0;if(elementSelector.length){if(typeof elementSelector==="string"){elementList=document.querySelectorAll(elementSelector)}else{elementList=elementSelector}[].forEach.call(elementList,callback.bind(this))}else{callback.call(this,elementSelector)}}function getUrlParameter(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regex=new RegExp("[\\?&]"+name+"=([^&#]*)"),results=regex.exec(location.search);return results===null?"":decodeURIComponent(results[1].replace(/\+/g," "))}function hasURLParameter(name){var regex=new RegExp("[?&]"+name);return"#"+name===window.location.hash||regex.test(window.location.search)}function createCookie(name,value,days){var expires;if(days){var date=new Date;date.setTime(date.getTime()+days*24*60*60*1e3);expires="; expires="+date.toGMTString()}else{expires=""}document.cookie=name+"="+value+expires+"; path=/"}function readCookie(name){var nameEQ=name+"=",cookieList=document.cookie.split(";");for(var i=0;i<cookieList.length;i++){var currentCookie=cookieList[i];while(currentCookie.charAt(0)==" "){currentCookie=currentCookie.substring(1,currentCookie.length)}if(currentCookie.indexOf(nameEQ)===0){return currentCookie.substring(nameEQ.length,currentCookie.length)}}return null}function eraseCookie(name){createCookie(name,"",-1)} | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:true});var _typeof=typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"?function(obj){return typeof obj}:function(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj};exports.isRTL=isRTL;exports.whichTransition=whichTransition;exports.createElWithAttrs=createElWithAttrs;exports.callbackOnElements=callbackOnElements;exports.getUrlParameter=getUrlParameter;exports.hasURLParameter=hasURLParameter;exports.createCookie=createCookie;exports.readCookie=readCookie;exports.eraseCookie=eraseCookie;exports.getTotalRect=getTotalRect;exports.scrollToPosition=scrollToPosition;(function(){if(!Element.prototype.matches){Element.prototype.matches=Element.prototype.msMatchesSelector}if(!Element.prototype.closest){Element.prototype.closest=_getClosest}})();function _getClosest(selector){var currentEl=this;while(currentEl.constructor!==HTMLHtmlElement){if(currentEl.parentNode.matches(selector)){return currentEl.parentNode}else if(currentEl.matches(selector)){return currentEl}currentEl=currentEl.parentNode}return false}var isMobile=exports.isMobile={Android:function Android(){return navigator.userAgent.match(/Android/i)},BlackBerry:function BlackBerry(){return navigator.userAgent.match(/BlackBerry/i)},iOS:function iOS(){return navigator.userAgent.match(/iPhone|iPad|iPod/i)},Opera:function Opera(){return navigator.userAgent.match(/Opera Mini/i)},Windows:function Windows(){return navigator.userAgent.match(/IEMobile/i)||navigator.userAgent.match(/WPDesktop/i)},any:function any(){return isMobile.Android()||isMobile.BlackBerry()||isMobile.iOS()||isMobile.Opera()||isMobile.Windows()}};function isRTL(){return document.documentElement.getAttribute("dir")==="rtl"?true:false}function whichTransition(){var dummyEl=document.createElement("dummy"),transitions={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(var key in transitions){if(dummyEl.style[key]!==undefined){return transitions[key]}}}function createElWithAttrs(appendTarget,attributes,type){var el=void 0;if((typeof type==="undefined"?"undefined":_typeof(type))==="object"){var fullNameSpace=type.nameSpace==="svg"?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml";el=document.createElementNS(fullNameSpace,type.tagName||"div")}else{el=document.createElement(type||"div")}for(var key in attributes){el.setAttribute(key,attributes[key])}if(appendTarget){appendTarget.appendChild(el)}return el}function callbackOnElements(elementSelector,callback){var elementList=void 0;if(elementSelector.length){if(typeof elementSelector==="string"){elementList=document.querySelectorAll(elementSelector)}else{elementList=elementSelector}[].forEach.call(elementList,callback.bind(this))}else{callback.call(this,elementSelector)}}function getUrlParameter(name){name=name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var regex=new RegExp("[\\?&]"+name+"=([^&#]*)"),results=regex.exec(location.search);return results===null?"":decodeURIComponent(results[1].replace(/\+/g," "))}function hasURLParameter(name){var regex=new RegExp("[?&]"+name);return"#"+name===window.location.hash||regex.test(window.location.search)}function createCookie(name,value,days){var expires;if(days){var date=new Date;date.setTime(date.getTime()+days*24*60*60*1e3);expires="; expires="+date.toGMTString()}else{expires=""}document.cookie=name+"="+value+expires+"; path=/"}function readCookie(name){var nameEQ=name+"=",cookieList=document.cookie.split(";");for(var i=0;i<cookieList.length;i++){var currentCookie=cookieList[i];while(currentCookie.charAt(0)==" "){currentCookie=currentCookie.substring(1,currentCookie.length)}if(currentCookie.indexOf(nameEQ)===0){return currentCookie.substring(nameEQ.length,currentCookie.length)}}return null}function eraseCookie(name){createCookie(name,"",-1)}function getTotalRect(elements,property){var totalOffsetHeight=0;callbackOnElements(elements,function(currentEl){totalOffsetHeight+=currentEl.getBoundingClientRect()[property||"height"]});return totalOffsetHeight}function scrollToPosition(target){var offset=arguments.length>1&&arguments[1]!==undefined?arguments[1]:0;var documentHeight=Math.max(document.body.scrollHeight,document.body.offsetHeight,document.documentElement.clientHeight,document.documentElement.scrollHeight,document.documentElement.offsetHeight),documentScrollTop=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop,windowHeight=document.documentElement.clientHeight,totalOffset=typeof offset==="number"?offset:getTotalRect(offset),targetOffset=typeof target==="number"?target:getTotalRect(target,"top")+documentScrollTop,targetOffsetToScroll=Math.round(documentHeight-targetOffset<windowHeight?documentHeight-windowHeight:targetOffset);targetOffsetToScroll-=totalOffset;return targetOffsetToScroll} |
{ | ||
"name": "@borngroup/born-utilities", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "Set of useful utilities for BORN projects.", | ||
@@ -5,0 +5,0 @@ "main": "dist/born-utilities.min.js", |
@@ -224,2 +224,35 @@ /** | ||
createCookie(name, '', -1); | ||
} | ||
/** | ||
* Adds the specified getBoundingClientRect()[`property`] from each node found in `elements`. | ||
* @return {Integer} [description] | ||
*/ | ||
export function getTotalRect (elements, property) { | ||
let totalOffsetHeight = 0; | ||
callbackOnElements(elements, function(currentEl) { | ||
totalOffsetHeight += currentEl.getBoundingClientRect()[property || 'height']; | ||
}); | ||
return totalOffsetHeight; | ||
} | ||
/** | ||
* Returns the target relative to the current window scroll position. | ||
* @param {HTMLElement | HTML Selector | Number} target [Target element(s) or position value to scroll to] | ||
* @param {HTMLElement | NodeList | HTML Selector | Number} offset [Offset element to calculate the height from, or offset value to substract] | ||
*/ | ||
export function scrollToPosition (target, offset = 0) { | ||
let documentHeight = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight), | ||
documentScrollTop = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop, | ||
windowHeight = document.documentElement.clientHeight, | ||
totalOffset = typeof offset === 'number' ? offset : getTotalRect(offset), | ||
targetOffset = typeof target === 'number' ? target : getTotalRect(target, 'top') + documentScrollTop, | ||
targetOffsetToScroll = Math.round(documentHeight - targetOffset < windowHeight ? documentHeight - windowHeight : targetOffset); | ||
//Remove manual offset from target position. | ||
targetOffsetToScroll -= totalOffset; | ||
return targetOffsetToScroll; | ||
} |
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
37290
660