version 1.6.3

This commit is contained in:
Rene
2019-01-31 15:37:13 +01:00
parent 14ca9d2f14
commit 69088109cd
7 changed files with 53 additions and 29 deletions
+21 -9
View File
@@ -2,13 +2,13 @@
* OverlayScrollbars
* https://github.com/KingSora/OverlayScrollbars
*
* Version: 1.6.2
* Version: 1.6.3
*
* Copyright KingSora.
* https://github.com/KingSora
*
* Released under the MIT license.
* Date: 16.01.2019
* Date: 31.01.2019
*/
(function (global, factory) {
@@ -3205,10 +3205,13 @@
//activate or deactivate size auto capability
if (sizeAutoCapableChanged) {
if (sizeAutoCapable) {
if (_contentGlueElement === undefined) {
if (!_contentGlueElement) {
_contentGlueElement = FRAMEWORK(generateDiv(_classNameContentGlueElement));
_paddingElement.before(_contentGlueElement);
}
else {
_contentGlueElement.show();
}
if (_sizeAutoObserverAdded) {
_sizeAutoObserverElement.show();
}
@@ -3241,6 +3244,8 @@
else {
if (_sizeAutoObserverAdded)
_sizeAutoObserverElement.hide();
if (_contentGlueElement)
_contentGlueElement.hide();
}
}
@@ -3307,7 +3312,7 @@
var wasWidthAuto = !widthAuto && _widthAutoCache;
//detect height auto:
var heightAuto = _sizeAutoObserverAdded && !displayIsHidden ? (MATH.round(sizeAutoObserverElementBCRect.bottom - sizeAutoObserverElementBCRect.top) === 0) /* && (!paddingAbsolute && (_msieVersion > 9 || !_msieVersion) ? true : true) */ : false;
var heightAuto = _sizeAutoObserverAdded && sizeAutoCapable && !displayIsHidden ? (MATH.round(sizeAutoObserverElementBCRect.bottom - sizeAutoObserverElementBCRect.top) === 0) /* && (!paddingAbsolute && (_msieVersion > 9 || !_msieVersion) ? true : true) */ : false;
var heightAutoChanged = checkCacheSingle(heightAuto, _heightAutoCache, force);
var wasHeightAuto = !heightAuto && _heightAutoCache;
@@ -3464,6 +3469,9 @@
contentElementCSS[_strWidth] = _strAuto;
contentElementCSS[_strFloat] = isRTLRight;
}
else {
contentGlueElementCSS[_strWidth] = _strEmpty;
}
if (heightAuto) {
if (!cssMaxValue.ch)
contentElementCSS[_strMaxMinus + _strHeight] = _strEmpty;
@@ -3471,6 +3479,9 @@
//contentGlueElementCSS[_strHeight] = _isTextarea && textareaDynHeight ? textareaSize.dh : _strAuto;
contentGlueElementCSS[_strHeight] = _isTextarea ? textareaDynHeight ? textareaSize.dh : _strAuto : _contentElement[0][LEXICON.cH];
}
else {
contentGlueElementCSS[_strHeight] = _strEmpty;
}
if (sizeAutoCapable)
_contentGlueElement.css(contentGlueElementCSS);
_contentElement.css(contentElementCSS);
@@ -3480,7 +3491,7 @@
contentGlueElementCSS = {};
//if [content(host) client / scroll size, or target element direction, or content(host) max-sizes] changed, or force is true
if (hostSizeChanged || contentSizeChanged || cssDirectionChanged || boxSizingChanged || paddingAbsoluteChanged || widthAutoChanged || widthAuto || heightAutoChanged || heightAuto || cssMaxValue.c || ignoreOverlayScrollbarHidingChanged || overflowBehaviorChanged || clipAlwaysChanged || resizeChanged || scrollbarsVisibilityChanged || textareaDynWidthChanged || textareaDynHeightChanged || textareaAutoWrappingChanged || force) {
if (hostSizeChanged || contentSizeChanged || cssDirectionChanged || boxSizingChanged || paddingAbsoluteChanged || widthAutoChanged || widthAuto || heightAutoChanged || heightAuto || cssMaxValue.c || ignoreOverlayScrollbarHidingChanged || overflowBehaviorChanged || clipAlwaysChanged || resizeChanged || scrollbarsVisibilityChanged || scrollbarsAutoHideChanged || scrollbarsDragScrollingChanged || scrollbarsClickScrollingChanged || textareaDynWidthChanged || textareaDynHeightChanged || textareaAutoWrappingChanged || force) {
var strOverflow = 'overflow';
var strOverflowX = strOverflow + '-x';
var strOverflowY = strOverflow + '-y';
@@ -5195,12 +5206,13 @@
var isString = type(force) == TYPES.s;
var imgElementSelector = 'img';
var imgElementLoadEvent = 'load';
var isPlus = isString && force.slice(-1) == '+';
if(isString) {
if (force.indexOf(_strAuto) === 0) {
attrsChanged = meaningfulAttrsChanged();
contentSizeC = updateAutoContentSizeChanged();
if (attrsChanged || contentSizeC)
update(false, contentSizeC, false, force.slice(-1) == "+");
if (attrsChanged || contentSizeC || isPlus)
update(false, contentSizeC, false, isPlus);
}
else if (force === 'zoom')
update(true, true);
@@ -5510,7 +5522,7 @@
var getFinalScroll = function (isX, rawScroll) {
var isString = type(rawScroll) == TYPES.s;
if(isString)
_base.update(_strAuto + "+");
_base.update(_strAuto + '+');
var operator;
var amount;
var scrollInfo = isX ? _scrollHorizontalInfo : _scrollVerticalInfo;
@@ -5642,7 +5654,7 @@
if (finalElement[strLength] === 0)
return;
_base.update(_strAuto + "+");
_base.update(_strAuto + '+');
//margin can be [ boolean, number, array of 2, array of 4, object ]
if (marginType == TYPES.n || marginType == TYPES.b)
+3 -3
View File
File diff suppressed because one or more lines are too long
+21 -9
View File
@@ -2,13 +2,13 @@
* OverlayScrollbars
* https://github.com/KingSora/OverlayScrollbars
*
* Version: 1.6.2
* Version: 1.6.3
*
* Copyright KingSora.
* https://github.com/KingSora
*
* Released under the MIT license.
* Date: 16.01.2019
* Date: 31.01.2019
*/
(function (global, factory) {
@@ -2127,10 +2127,13 @@
//activate or deactivate size auto capability
if (sizeAutoCapableChanged) {
if (sizeAutoCapable) {
if (_contentGlueElement === undefined) {
if (!_contentGlueElement) {
_contentGlueElement = FRAMEWORK(generateDiv(_classNameContentGlueElement));
_paddingElement.before(_contentGlueElement);
}
else {
_contentGlueElement.show();
}
if (_sizeAutoObserverAdded) {
_sizeAutoObserverElement.show();
}
@@ -2163,6 +2166,8 @@
else {
if (_sizeAutoObserverAdded)
_sizeAutoObserverElement.hide();
if (_contentGlueElement)
_contentGlueElement.hide();
}
}
@@ -2229,7 +2234,7 @@
var wasWidthAuto = !widthAuto && _widthAutoCache;
//detect height auto:
var heightAuto = _sizeAutoObserverAdded && !displayIsHidden ? (MATH.round(sizeAutoObserverElementBCRect.bottom - sizeAutoObserverElementBCRect.top) === 0) /* && (!paddingAbsolute && (_msieVersion > 9 || !_msieVersion) ? true : true) */ : false;
var heightAuto = _sizeAutoObserverAdded && sizeAutoCapable && !displayIsHidden ? (MATH.round(sizeAutoObserverElementBCRect.bottom - sizeAutoObserverElementBCRect.top) === 0) /* && (!paddingAbsolute && (_msieVersion > 9 || !_msieVersion) ? true : true) */ : false;
var heightAutoChanged = checkCacheSingle(heightAuto, _heightAutoCache, force);
var wasHeightAuto = !heightAuto && _heightAutoCache;
@@ -2386,6 +2391,9 @@
contentElementCSS[_strWidth] = _strAuto;
contentElementCSS[_strFloat] = isRTLRight;
}
else {
contentGlueElementCSS[_strWidth] = _strEmpty;
}
if (heightAuto) {
if (!cssMaxValue.ch)
contentElementCSS[_strMaxMinus + _strHeight] = _strEmpty;
@@ -2393,6 +2401,9 @@
//contentGlueElementCSS[_strHeight] = _isTextarea && textareaDynHeight ? textareaSize.dh : _strAuto;
contentGlueElementCSS[_strHeight] = _isTextarea ? textareaDynHeight ? textareaSize.dh : _strAuto : _contentElement[0][LEXICON.cH];
}
else {
contentGlueElementCSS[_strHeight] = _strEmpty;
}
if (sizeAutoCapable)
_contentGlueElement.css(contentGlueElementCSS);
_contentElement.css(contentElementCSS);
@@ -2402,7 +2413,7 @@
contentGlueElementCSS = {};
//if [content(host) client / scroll size, or target element direction, or content(host) max-sizes] changed, or force is true
if (hostSizeChanged || contentSizeChanged || cssDirectionChanged || boxSizingChanged || paddingAbsoluteChanged || widthAutoChanged || widthAuto || heightAutoChanged || heightAuto || cssMaxValue.c || ignoreOverlayScrollbarHidingChanged || overflowBehaviorChanged || clipAlwaysChanged || resizeChanged || scrollbarsVisibilityChanged || textareaDynWidthChanged || textareaDynHeightChanged || textareaAutoWrappingChanged || force) {
if (hostSizeChanged || contentSizeChanged || cssDirectionChanged || boxSizingChanged || paddingAbsoluteChanged || widthAutoChanged || widthAuto || heightAutoChanged || heightAuto || cssMaxValue.c || ignoreOverlayScrollbarHidingChanged || overflowBehaviorChanged || clipAlwaysChanged || resizeChanged || scrollbarsVisibilityChanged || scrollbarsAutoHideChanged || scrollbarsDragScrollingChanged || scrollbarsClickScrollingChanged || textareaDynWidthChanged || textareaDynHeightChanged || textareaAutoWrappingChanged || force) {
var strOverflow = 'overflow';
var strOverflowX = strOverflow + '-x';
var strOverflowY = strOverflow + '-y';
@@ -4117,12 +4128,13 @@
var isString = type(force) == TYPES.s;
var imgElementSelector = 'img';
var imgElementLoadEvent = 'load';
var isPlus = isString && force.slice(-1) == '+';
if(isString) {
if (force.indexOf(_strAuto) === 0) {
attrsChanged = meaningfulAttrsChanged();
contentSizeC = updateAutoContentSizeChanged();
if (attrsChanged || contentSizeC)
update(false, contentSizeC, false, force.slice(-1) == "+");
if (attrsChanged || contentSizeC || isPlus)
update(false, contentSizeC, false, isPlus);
}
else if (force === 'zoom')
update(true, true);
@@ -4432,7 +4444,7 @@
var getFinalScroll = function (isX, rawScroll) {
var isString = type(rawScroll) == TYPES.s;
if(isString)
_base.update(_strAuto + "+");
_base.update(_strAuto + '+');
var operator;
var amount;
var scrollInfo = isX ? _scrollHorizontalInfo : _scrollVerticalInfo;
@@ -4564,7 +4576,7 @@
if (finalElement[strLength] === 0)
return;
_base.update(_strAuto + "+");
_base.update(_strAuto + '+');
//margin can be [ boolean, number, array of 2, array of 4, object ]
if (marginType == TYPES.n || marginType == TYPES.b)
+3 -3
View File
File diff suppressed because one or more lines are too long