mirror of
https://github.com/tenrok/OverlayScrollbars.git
synced 2026-06-17 17:50:37 +03:00
version 1.5.1
This commit is contained in:
@@ -2,13 +2,13 @@
|
|||||||
* OverlayScrollbars
|
* OverlayScrollbars
|
||||||
* https://github.com/KingSora/OverlayScrollbars
|
* https://github.com/KingSora/OverlayScrollbars
|
||||||
*
|
*
|
||||||
* Version: 1.5.0
|
* Version: 1.5.1
|
||||||
*
|
*
|
||||||
* Copyright KingSora.
|
* Copyright KingSora.
|
||||||
* https://github.com/KingSora
|
* https://github.com/KingSora
|
||||||
*
|
*
|
||||||
* Released under the MIT license.
|
* Released under the MIT license.
|
||||||
* Date: 21.06.2018
|
* Date: 13.07.2018
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Vendored
+2
-2
File diff suppressed because one or more lines are too long
+45
-50
@@ -2,13 +2,13 @@
|
|||||||
* OverlayScrollbars
|
* OverlayScrollbars
|
||||||
* https://github.com/KingSora/OverlayScrollbars
|
* https://github.com/KingSora/OverlayScrollbars
|
||||||
*
|
*
|
||||||
* Version: 1.5.0
|
* Version: 1.5.1
|
||||||
*
|
*
|
||||||
* Copyright KingSora.
|
* Copyright KingSora.
|
||||||
* https://github.com/KingSora
|
* https://github.com/KingSora
|
||||||
*
|
*
|
||||||
* Released under the MIT license.
|
* Released under the MIT license.
|
||||||
* Date: 21.06.2018
|
* Date: 13.07.2018
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function (global, factory) {
|
(function (global, factory) {
|
||||||
@@ -1228,15 +1228,13 @@
|
|||||||
|
|
||||||
is : function(selector) {
|
is : function(selector) {
|
||||||
var el;
|
var el;
|
||||||
var elVisible;
|
|
||||||
var i;
|
var i;
|
||||||
for(i = 0; i < this[LEXICON.l]; i++) {
|
for(i = 0; i < this[LEXICON.l]; i++) {
|
||||||
el = this[i];
|
el = this[i];
|
||||||
elVisible = !!(el[LEXICON.oW] || el[LEXICON.oH] || el.getClientRects()[LEXICON.l]);
|
|
||||||
if(selector === ":visible")
|
if(selector === ":visible")
|
||||||
return elVisible;
|
return !!(el[LEXICON.oW] || el[LEXICON.oH] || el.getClientRects()[LEXICON.l]);
|
||||||
if(selector === ":hidden")
|
if(selector === ":hidden")
|
||||||
return !elVisible;
|
return !!!(el[LEXICON.oW] || el[LEXICON.oH] || el.getClientRects()[LEXICON.l]);
|
||||||
if((el.matches && el.matches(selector)) || matches(el, selector))
|
if((el.matches && el.matches(selector)) || matches(el, selector))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -2024,7 +2022,7 @@
|
|||||||
var _lastUpdateTime;
|
var _lastUpdateTime;
|
||||||
var _swallowedUpdateParams = { };
|
var _swallowedUpdateParams = { };
|
||||||
var _swallowedUpdateTimeout;
|
var _swallowedUpdateTimeout;
|
||||||
var _swallowUpdateLag = 33;
|
var _swallowUpdateLag = 42;
|
||||||
var _imgs = [ ];
|
var _imgs = [ ];
|
||||||
|
|
||||||
//DOM elements:
|
//DOM elements:
|
||||||
@@ -2826,9 +2824,9 @@
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
var float;
|
var float;
|
||||||
var viewportScrollSize;
|
|
||||||
var textareaValueLength = _isTextarea && _widthAutoCache && !_textareaAutoWrappingCache ? _targetElement.val().length : 0;
|
var textareaValueLength = _isTextarea && _widthAutoCache && !_textareaAutoWrappingCache ? _targetElement.val().length : 0;
|
||||||
var setCSS = !_mutationObserverConnected && _widthAutoCache && !_isTextarea;
|
var setCSS = !_mutationObserverConnected && _widthAutoCache && !_isTextarea;
|
||||||
|
var viewportScrollSize = { };
|
||||||
var css = { };
|
var css = { };
|
||||||
|
|
||||||
//fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1439305, it only works with "clipAlways : true"
|
//fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1439305, it only works with "clipAlways : true"
|
||||||
@@ -3539,10 +3537,15 @@
|
|||||||
h: _isTextarea && textareaSize && !textareaDynHeight ? textareaSize.oh : heightAuto ? clientSize.h : scrollSize.h
|
h: _isTextarea && textareaSize && !textareaDynHeight ? textareaSize.oh : heightAuto ? clientSize.h : scrollSize.h
|
||||||
};
|
};
|
||||||
|
|
||||||
//apply the correct viewport style
|
//apply the correct viewport style and measure viewport size
|
||||||
viewportElementResetCSS[_strBottom] = wasHeightAuto ? _strEmpty : resetBottomTmp;
|
viewportElementResetCSS[_strBottom] = wasHeightAuto ? _strEmpty : resetBottomTmp;
|
||||||
viewportElementResetCSS[isRTLLeft] = wasWidthAuto ? _strEmpty : resetXTmp;
|
viewportElementResetCSS[isRTLLeft] = wasWidthAuto ? _strEmpty : resetXTmp;
|
||||||
_viewportElement.css(viewportElementResetCSS);
|
_viewportElement.css(viewportElementResetCSS);
|
||||||
|
//viewport size is padding container because it never has padding, margin and a border.
|
||||||
|
_viewportSize = {
|
||||||
|
w: paddingElement[LEXICON.oW],
|
||||||
|
h: paddingElement[LEXICON.oH]
|
||||||
|
};
|
||||||
|
|
||||||
//measure and correct several sizes
|
//measure and correct several sizes
|
||||||
//has to be clientSize because offsetSize respect borders.
|
//has to be clientSize because offsetSize respect borders.
|
||||||
@@ -3639,12 +3642,6 @@
|
|||||||
hostSizeChanged = checkCacheDouble(hostSize, _hostSizeCache);
|
hostSizeChanged = checkCacheDouble(hostSize, _hostSizeCache);
|
||||||
_hostSizeCache = hostSize;
|
_hostSizeCache = hostSize;
|
||||||
|
|
||||||
//viewport size is padding container because it never has padding, margin and a border.
|
|
||||||
_viewportSize = {
|
|
||||||
w: paddingElement[LEXICON.oW],
|
|
||||||
h: paddingElement[LEXICON.oH]
|
|
||||||
};
|
|
||||||
|
|
||||||
var overflowBehaviorIsVS = {
|
var overflowBehaviorIsVS = {
|
||||||
x: overflowBehavior.x === 'v-s',
|
x: overflowBehavior.x === 'v-s',
|
||||||
y: overflowBehavior.y === 'v-s'
|
y: overflowBehavior.y === 'v-s'
|
||||||
@@ -3701,56 +3698,45 @@
|
|||||||
|
|
||||||
//if native scrollbar is overlay at x OR y axis, prepare DOM
|
//if native scrollbar is overlay at x OR y axis, prepare DOM
|
||||||
if (_nativeScrollbarIsOverlaid.x || _nativeScrollbarIsOverlaid.y) {
|
if (_nativeScrollbarIsOverlaid.x || _nativeScrollbarIsOverlaid.y) {
|
||||||
|
var borderDesign = 'px solid transparent';
|
||||||
|
var contentArrangeElementCSS = { };
|
||||||
|
var arrangeContent = { };
|
||||||
var arrangeChanged = force;
|
var arrangeChanged = force;
|
||||||
var arrangeContent = {};
|
|
||||||
if (hasOverflow.x || hasOverflow.y) {
|
if (hasOverflow.x || hasOverflow.y) {
|
||||||
arrangeContent.w = _nativeScrollbarIsOverlaid.y && hasOverflow.y ? contentScrollSize.w + _overlayScrollbarDummySize.y : _strEmpty;
|
arrangeContent.w = _nativeScrollbarIsOverlaid.y && hasOverflow.y ? contentScrollSize.w + _overlayScrollbarDummySize.y : _strEmpty;
|
||||||
arrangeContent.h = _nativeScrollbarIsOverlaid.x && hasOverflow.x ? contentScrollSize.h + _overlayScrollbarDummySize.x : _strEmpty;
|
arrangeContent.h = _nativeScrollbarIsOverlaid.x && hasOverflow.x ? contentScrollSize.h + _overlayScrollbarDummySize.x : _strEmpty;
|
||||||
|
|
||||||
arrangeChanged = checkCacheSingle(arrangeContent, _arrangeContentSizeCache, force);
|
arrangeChanged = checkCacheSingle(arrangeContent, _arrangeContentSizeCache, force);
|
||||||
_arrangeContentSizeCache = arrangeContent;
|
_arrangeContentSizeCache = arrangeContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasOverflow.c || hideOverflow.c || contentScrollSize.c || cssDirectionChanged || widthAutoChanged || heightAutoChanged || widthAuto || heightAuto || ignoreOverlayScrollbarHidingChanged) {
|
if (hasOverflow.c || hideOverflow.c || contentScrollSize.c || cssDirectionChanged || widthAutoChanged || heightAutoChanged || widthAuto || heightAuto || ignoreOverlayScrollbarHidingChanged) {
|
||||||
var borderDesign = 'px solid transparent';
|
contentElementCSS[_strMarginMinus + isRTLRight] = contentElementCSS[_strBorderMinus + isRTLRight] = _strEmpty;
|
||||||
contentElementCSS[_strBorderMinus + isRTLRight] = _strEmpty;
|
|
||||||
contentElementCSS[_strMarginMinus + isRTLRight] = _strEmpty;
|
|
||||||
if (_nativeScrollbarIsOverlaid.x && hasOverflow.x && hideOverflow.xs) {
|
if (_nativeScrollbarIsOverlaid.x && hasOverflow.x && hideOverflow.xs) {
|
||||||
if (heightAuto)
|
contentElementCSS[_strMarginMinus + _strBottom] = heightAuto ? (ignoreOverlayScrollbarHiding ? _strEmpty : _overlayScrollbarDummySize.x) : _strEmpty;
|
||||||
contentElementCSS[_strMarginMinus + _strBottom] = ignoreOverlayScrollbarHiding ? _strEmpty : _overlayScrollbarDummySize.x;
|
contentElementCSS[_strBorderMinus + _strBottom] = (!heightAuto && !ignoreOverlayScrollbarHiding) ? (_overlayScrollbarDummySize.x + borderDesign) : _strEmpty;
|
||||||
if (!heightAuto && !ignoreOverlayScrollbarHiding)
|
|
||||||
contentElementCSS[_strBorderMinus + _strBottom] = _overlayScrollbarDummySize.x + borderDesign;
|
|
||||||
else
|
|
||||||
contentElementCSS[_strBorderMinus + _strBottom] = _strEmpty;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
arrangeContent.h = _strEmpty;
|
arrangeContent.h =
|
||||||
arrangeChanged = true;
|
contentElementCSS[_strMarginMinus + _strBottom] =
|
||||||
contentElementCSS[_strBorderMinus + _strBottom] = _strEmpty;
|
contentElementCSS[_strBorderMinus + _strBottom] = _strEmpty;
|
||||||
contentElementCSS[_strMarginMinus + _strBottom] = _strEmpty;
|
arrangeChanged = true;
|
||||||
}
|
}
|
||||||
if (_nativeScrollbarIsOverlaid.y && hasOverflow.y && hideOverflow.ys) {
|
if (_nativeScrollbarIsOverlaid.y && hasOverflow.y && hideOverflow.ys) {
|
||||||
if (widthAuto)
|
contentElementCSS[_strMarginMinus + isRTLLeft] = widthAuto ? (ignoreOverlayScrollbarHiding ? _strEmpty : _overlayScrollbarDummySize.y) : _strEmpty;
|
||||||
contentElementCSS[_strMarginMinus + isRTLLeft] = ignoreOverlayScrollbarHiding ? _strEmpty : _overlayScrollbarDummySize.y;
|
contentElementCSS[_strBorderMinus + isRTLLeft] = (/* !widthAuto && */ !ignoreOverlayScrollbarHiding) ? (_overlayScrollbarDummySize.y + borderDesign) : _strEmpty;
|
||||||
if (/* !widthAuto && */ !ignoreOverlayScrollbarHiding)
|
|
||||||
contentElementCSS[_strBorderMinus + isRTLLeft] = _overlayScrollbarDummySize.y + borderDesign;
|
|
||||||
else
|
|
||||||
contentElementCSS[_strBorderMinus + isRTLLeft] = _strEmpty;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
arrangeContent.w = _strEmpty;
|
arrangeContent.w =
|
||||||
arrangeChanged = true;
|
contentElementCSS[_strMarginMinus + isRTLLeft] =
|
||||||
contentElementCSS[_strBorderMinus + isRTLLeft] = _strEmpty;
|
contentElementCSS[_strBorderMinus + isRTLLeft] = _strEmpty;
|
||||||
contentElementCSS[_strMarginMinus + isRTLLeft] = _strEmpty;
|
arrangeChanged = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ignoreOverlayScrollbarHiding) {
|
if (ignoreOverlayScrollbarHiding) {
|
||||||
arrangeContent.w = _strEmpty;
|
arrangeContent.w = arrangeContent.h = _strEmpty;
|
||||||
arrangeContent.h = _strEmpty;
|
|
||||||
arrangeChanged = true;
|
arrangeChanged = true;
|
||||||
}
|
}
|
||||||
if (arrangeChanged) {
|
if (arrangeChanged) {
|
||||||
var contentArrangeElementCSS = { };
|
|
||||||
contentArrangeElementCSS[_strWidth] = hideOverflow.y ? arrangeContent.w : _strEmpty;
|
contentArrangeElementCSS[_strWidth] = hideOverflow.y ? arrangeContent.w : _strEmpty;
|
||||||
contentArrangeElementCSS[_strHeight] = hideOverflow.x ? arrangeContent.h : _strEmpty;
|
contentArrangeElementCSS[_strHeight] = hideOverflow.x ? arrangeContent.h : _strEmpty;
|
||||||
|
|
||||||
@@ -3814,20 +3800,19 @@
|
|||||||
viewportElementCSS[_strMarginMinus + isRTLRight] = -_nativeScrollbarMinSize.y;
|
viewportElementCSS[_strMarginMinus + isRTLRight] = -_nativeScrollbarMinSize.y;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
viewportElementCSS[_strPaddingMinus + _strTop] = _strEmpty;
|
viewportElementCSS[_strPaddingMinus + _strTop] =
|
||||||
viewportElementCSS[_strMarginMinus + _strTop] = _strEmpty;
|
viewportElementCSS[_strMarginMinus + _strTop] =
|
||||||
|
viewportElementCSS[_strPaddingMinus + isRTLRight] =
|
||||||
viewportElementCSS[_strPaddingMinus + isRTLRight] = _strEmpty;
|
|
||||||
viewportElementCSS[_strMarginMinus + isRTLRight] = _strEmpty;
|
viewportElementCSS[_strMarginMinus + isRTLRight] = _strEmpty;
|
||||||
}
|
}
|
||||||
viewportElementCSS[_strPaddingMinus + isRTLLeft] = _strEmpty;
|
viewportElementCSS[_strPaddingMinus + isRTLLeft] =
|
||||||
viewportElementCSS[_strMarginMinus + isRTLLeft] = _strEmpty;
|
viewportElementCSS[_strMarginMinus + isRTLLeft] = _strEmpty;
|
||||||
|
|
||||||
//if there is any overflow (x OR y axis) and this overflow shall be hidden, make overflow hidden, else overflow visible
|
//if there is any overflow (x OR y axis) and this overflow shall be hidden, make overflow hidden, else overflow visible
|
||||||
if ((hasOverflow.x && hideOverflow.x) || (hasOverflow.y && hideOverflow.y) || hideOverflowForceTextarea) {
|
if ((hasOverflow.x && hideOverflow.x) || (hasOverflow.y && hideOverflow.y) || hideOverflowForceTextarea) {
|
||||||
//only hide if is Textarea
|
//only hide if is Textarea
|
||||||
if (_isTextarea && hideOverflowForceTextarea) {
|
if (_isTextarea && hideOverflowForceTextarea) {
|
||||||
paddingElementCSS[strOverflowX] = strHidden;
|
paddingElementCSS[strOverflowX] =
|
||||||
paddingElementCSS[strOverflowY] = strHidden;
|
paddingElementCSS[strOverflowY] = strHidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3835,10 +3820,10 @@
|
|||||||
if (!clipAlways || (overflowBehaviorIsVH.x || overflowBehaviorIsVS.x || overflowBehaviorIsVH.y || overflowBehaviorIsVS.y)) {
|
if (!clipAlways || (overflowBehaviorIsVH.x || overflowBehaviorIsVS.x || overflowBehaviorIsVH.y || overflowBehaviorIsVS.y)) {
|
||||||
//only un-hide if Textarea
|
//only un-hide if Textarea
|
||||||
if (_isTextarea) {
|
if (_isTextarea) {
|
||||||
paddingElementCSS[strOverflowX] = _strEmpty;
|
paddingElementCSS[strOverflowX] =
|
||||||
paddingElementCSS[strOverflowY] = _strEmpty;
|
paddingElementCSS[strOverflowY] = _strEmpty;
|
||||||
}
|
}
|
||||||
viewportElementCSS[strOverflowX] = strVisible;
|
viewportElementCSS[strOverflowX] =
|
||||||
viewportElementCSS[strOverflowY] = strVisible;
|
viewportElementCSS[strOverflowY] = strVisible;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5403,6 +5388,7 @@
|
|||||||
else
|
else
|
||||||
margin = marginDefault;
|
margin = marginDefault;
|
||||||
|
|
||||||
|
//block = type(block) === TYPES.b ? block ? [ strNearest, strBegin ] : [ strNearest, strEnd ] : block;
|
||||||
settingsAxis = checkSettingsStringValue(axis, elementObjSettingsAxisValues) ? axis : 'xy';
|
settingsAxis = checkSettingsStringValue(axis, elementObjSettingsAxisValues) ? axis : 'xy';
|
||||||
settingsScroll = getPerAxisValue(scroll, TYPES.s, strAlways, elementObjSettingsScrollValues);
|
settingsScroll = getPerAxisValue(scroll, TYPES.s, strAlways, elementObjSettingsScrollValues);
|
||||||
settingsBlock = getPerAxisValue(block, TYPES.s, strBegin, elementObjSettingsBlockValues);
|
settingsBlock = getPerAxisValue(block, TYPES.s, strBegin, elementObjSettingsBlockValues);
|
||||||
@@ -5435,7 +5421,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//measuring is required
|
//measuring is required
|
||||||
if (settingsBlock.x != strBegin || settingsBlock.y != strBegin || settingsScroll.x == strIfNeeded || settingsScroll.y == strIfNeeded) {
|
if (settingsBlock.x != strBegin || settingsBlock.y != strBegin || settingsScroll.x == strIfNeeded || settingsScroll.y == strIfNeeded || _isRTL) {
|
||||||
var measuringElm = finalElement[0];
|
var measuringElm = finalElement[0];
|
||||||
var rawElementSize = {};
|
var rawElementSize = {};
|
||||||
var rect;
|
var rect;
|
||||||
@@ -5822,6 +5808,7 @@
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var doUpdate = false;
|
var doUpdate = false;
|
||||||
|
//var doUpdateScrollbars = false;
|
||||||
var mutation;
|
var mutation;
|
||||||
framework.each(mutations, function () {
|
framework.each(mutations, function () {
|
||||||
mutation = this;
|
mutation = this;
|
||||||
@@ -5841,6 +5828,14 @@
|
|||||||
|
|
||||||
if (doUpdate)
|
if (doUpdate)
|
||||||
_base.update(_strAuto);
|
_base.update(_strAuto);
|
||||||
|
/*
|
||||||
|
if(doUpdateScrollbars) {
|
||||||
|
refreshScrollbarHandleLength(true);
|
||||||
|
refreshScrollbarHandleOffset(true, _scrollHorizontalInfo.cs);
|
||||||
|
refreshScrollbarHandleLength(false);
|
||||||
|
refreshScrollbarHandleOffset(false, _scrollVerticalInfo.cs);
|
||||||
|
}
|
||||||
|
*/
|
||||||
});
|
});
|
||||||
_mutationObserverContent = new mutationObserver(function (mutations) {
|
_mutationObserverContent = new mutationObserver(function (mutations) {
|
||||||
if (!_initialized || _isSleeping)
|
if (!_initialized || _isSleeping)
|
||||||
|
|||||||
Vendored
+3
-3
File diff suppressed because one or more lines are too long
@@ -2,13 +2,13 @@
|
|||||||
* OverlayScrollbars
|
* OverlayScrollbars
|
||||||
* https://github.com/KingSora/OverlayScrollbars
|
* https://github.com/KingSora/OverlayScrollbars
|
||||||
*
|
*
|
||||||
* Version: 1.5.0
|
* Version: 1.5.1
|
||||||
*
|
*
|
||||||
* Copyright KingSora.
|
* Copyright KingSora.
|
||||||
* https://github.com/KingSora
|
* https://github.com/KingSora
|
||||||
*
|
*
|
||||||
* Released under the MIT license.
|
* Released under the MIT license.
|
||||||
* Date: 21.06.2018
|
* Date: 13.07.2018
|
||||||
*/
|
*/
|
||||||
|
|
||||||
(function (global, factory) {
|
(function (global, factory) {
|
||||||
@@ -159,7 +159,6 @@
|
|||||||
|
|
||||||
// Calculate pageX/Y if not native supported
|
// Calculate pageX/Y if not native supported
|
||||||
if (!event[strPage + strX] && event[strClient + strX] && event[strClient + strX] != null) {
|
if (!event[strPage + strX] && event[strClient + strX] && event[strClient + strX] != null) {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
x : event[strClient + strX] +
|
x : event[strClient + strX] +
|
||||||
(doc && doc.scrollLeft || body && body.scrollLeft || 0) -
|
(doc && doc.scrollLeft || body && body.scrollLeft || 0) -
|
||||||
@@ -966,7 +965,7 @@
|
|||||||
var _lastUpdateTime;
|
var _lastUpdateTime;
|
||||||
var _swallowedUpdateParams = { };
|
var _swallowedUpdateParams = { };
|
||||||
var _swallowedUpdateTimeout;
|
var _swallowedUpdateTimeout;
|
||||||
var _swallowUpdateLag = 33;
|
var _swallowUpdateLag = 42;
|
||||||
var _imgs = [ ];
|
var _imgs = [ ];
|
||||||
|
|
||||||
//DOM elements:
|
//DOM elements:
|
||||||
@@ -1768,9 +1767,9 @@
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
var float;
|
var float;
|
||||||
var viewportScrollSize;
|
|
||||||
var textareaValueLength = _isTextarea && _widthAutoCache && !_textareaAutoWrappingCache ? _targetElement.val().length : 0;
|
var textareaValueLength = _isTextarea && _widthAutoCache && !_textareaAutoWrappingCache ? _targetElement.val().length : 0;
|
||||||
var setCSS = !_mutationObserverConnected && _widthAutoCache && !_isTextarea;
|
var setCSS = !_mutationObserverConnected && _widthAutoCache && !_isTextarea;
|
||||||
|
var viewportScrollSize = { };
|
||||||
var css = { };
|
var css = { };
|
||||||
|
|
||||||
//fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1439305, it only works with "clipAlways : true"
|
//fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1439305, it only works with "clipAlways : true"
|
||||||
@@ -2481,10 +2480,15 @@
|
|||||||
h: _isTextarea && textareaSize && !textareaDynHeight ? textareaSize.oh : heightAuto ? clientSize.h : scrollSize.h
|
h: _isTextarea && textareaSize && !textareaDynHeight ? textareaSize.oh : heightAuto ? clientSize.h : scrollSize.h
|
||||||
};
|
};
|
||||||
|
|
||||||
//apply the correct viewport style
|
//apply the correct viewport style and measure viewport size
|
||||||
viewportElementResetCSS[_strBottom] = wasHeightAuto ? _strEmpty : resetBottomTmp;
|
viewportElementResetCSS[_strBottom] = wasHeightAuto ? _strEmpty : resetBottomTmp;
|
||||||
viewportElementResetCSS[isRTLLeft] = wasWidthAuto ? _strEmpty : resetXTmp;
|
viewportElementResetCSS[isRTLLeft] = wasWidthAuto ? _strEmpty : resetXTmp;
|
||||||
_viewportElement.css(viewportElementResetCSS);
|
_viewportElement.css(viewportElementResetCSS);
|
||||||
|
//viewport size is padding container because it never has padding, margin and a border.
|
||||||
|
_viewportSize = {
|
||||||
|
w: paddingElement[LEXICON.oW],
|
||||||
|
h: paddingElement[LEXICON.oH]
|
||||||
|
};
|
||||||
|
|
||||||
//measure and correct several sizes
|
//measure and correct several sizes
|
||||||
//has to be clientSize because offsetSize respect borders.
|
//has to be clientSize because offsetSize respect borders.
|
||||||
@@ -2581,12 +2585,6 @@
|
|||||||
hostSizeChanged = checkCacheDouble(hostSize, _hostSizeCache);
|
hostSizeChanged = checkCacheDouble(hostSize, _hostSizeCache);
|
||||||
_hostSizeCache = hostSize;
|
_hostSizeCache = hostSize;
|
||||||
|
|
||||||
//viewport size is padding container because it never has padding, margin and a border.
|
|
||||||
_viewportSize = {
|
|
||||||
w: paddingElement[LEXICON.oW],
|
|
||||||
h: paddingElement[LEXICON.oH]
|
|
||||||
};
|
|
||||||
|
|
||||||
var overflowBehaviorIsVS = {
|
var overflowBehaviorIsVS = {
|
||||||
x: overflowBehavior.x === 'v-s',
|
x: overflowBehavior.x === 'v-s',
|
||||||
y: overflowBehavior.y === 'v-s'
|
y: overflowBehavior.y === 'v-s'
|
||||||
@@ -2643,56 +2641,45 @@
|
|||||||
|
|
||||||
//if native scrollbar is overlay at x OR y axis, prepare DOM
|
//if native scrollbar is overlay at x OR y axis, prepare DOM
|
||||||
if (_nativeScrollbarIsOverlaid.x || _nativeScrollbarIsOverlaid.y) {
|
if (_nativeScrollbarIsOverlaid.x || _nativeScrollbarIsOverlaid.y) {
|
||||||
|
var borderDesign = 'px solid transparent';
|
||||||
|
var contentArrangeElementCSS = { };
|
||||||
|
var arrangeContent = { };
|
||||||
var arrangeChanged = force;
|
var arrangeChanged = force;
|
||||||
var arrangeContent = {};
|
|
||||||
if (hasOverflow.x || hasOverflow.y) {
|
if (hasOverflow.x || hasOverflow.y) {
|
||||||
arrangeContent.w = _nativeScrollbarIsOverlaid.y && hasOverflow.y ? contentScrollSize.w + _overlayScrollbarDummySize.y : _strEmpty;
|
arrangeContent.w = _nativeScrollbarIsOverlaid.y && hasOverflow.y ? contentScrollSize.w + _overlayScrollbarDummySize.y : _strEmpty;
|
||||||
arrangeContent.h = _nativeScrollbarIsOverlaid.x && hasOverflow.x ? contentScrollSize.h + _overlayScrollbarDummySize.x : _strEmpty;
|
arrangeContent.h = _nativeScrollbarIsOverlaid.x && hasOverflow.x ? contentScrollSize.h + _overlayScrollbarDummySize.x : _strEmpty;
|
||||||
|
|
||||||
arrangeChanged = checkCacheSingle(arrangeContent, _arrangeContentSizeCache, force);
|
arrangeChanged = checkCacheSingle(arrangeContent, _arrangeContentSizeCache, force);
|
||||||
_arrangeContentSizeCache = arrangeContent;
|
_arrangeContentSizeCache = arrangeContent;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasOverflow.c || hideOverflow.c || contentScrollSize.c || cssDirectionChanged || widthAutoChanged || heightAutoChanged || widthAuto || heightAuto || ignoreOverlayScrollbarHidingChanged) {
|
if (hasOverflow.c || hideOverflow.c || contentScrollSize.c || cssDirectionChanged || widthAutoChanged || heightAutoChanged || widthAuto || heightAuto || ignoreOverlayScrollbarHidingChanged) {
|
||||||
var borderDesign = 'px solid transparent';
|
contentElementCSS[_strMarginMinus + isRTLRight] = contentElementCSS[_strBorderMinus + isRTLRight] = _strEmpty;
|
||||||
contentElementCSS[_strBorderMinus + isRTLRight] = _strEmpty;
|
|
||||||
contentElementCSS[_strMarginMinus + isRTLRight] = _strEmpty;
|
|
||||||
if (_nativeScrollbarIsOverlaid.x && hasOverflow.x && hideOverflow.xs) {
|
if (_nativeScrollbarIsOverlaid.x && hasOverflow.x && hideOverflow.xs) {
|
||||||
if (heightAuto)
|
contentElementCSS[_strMarginMinus + _strBottom] = heightAuto ? (ignoreOverlayScrollbarHiding ? _strEmpty : _overlayScrollbarDummySize.x) : _strEmpty;
|
||||||
contentElementCSS[_strMarginMinus + _strBottom] = ignoreOverlayScrollbarHiding ? _strEmpty : _overlayScrollbarDummySize.x;
|
contentElementCSS[_strBorderMinus + _strBottom] = (!heightAuto && !ignoreOverlayScrollbarHiding) ? (_overlayScrollbarDummySize.x + borderDesign) : _strEmpty;
|
||||||
if (!heightAuto && !ignoreOverlayScrollbarHiding)
|
|
||||||
contentElementCSS[_strBorderMinus + _strBottom] = _overlayScrollbarDummySize.x + borderDesign;
|
|
||||||
else
|
|
||||||
contentElementCSS[_strBorderMinus + _strBottom] = _strEmpty;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
arrangeContent.h = _strEmpty;
|
arrangeContent.h =
|
||||||
arrangeChanged = true;
|
contentElementCSS[_strMarginMinus + _strBottom] =
|
||||||
contentElementCSS[_strBorderMinus + _strBottom] = _strEmpty;
|
contentElementCSS[_strBorderMinus + _strBottom] = _strEmpty;
|
||||||
contentElementCSS[_strMarginMinus + _strBottom] = _strEmpty;
|
arrangeChanged = true;
|
||||||
}
|
}
|
||||||
if (_nativeScrollbarIsOverlaid.y && hasOverflow.y && hideOverflow.ys) {
|
if (_nativeScrollbarIsOverlaid.y && hasOverflow.y && hideOverflow.ys) {
|
||||||
if (widthAuto)
|
contentElementCSS[_strMarginMinus + isRTLLeft] = widthAuto ? (ignoreOverlayScrollbarHiding ? _strEmpty : _overlayScrollbarDummySize.y) : _strEmpty;
|
||||||
contentElementCSS[_strMarginMinus + isRTLLeft] = ignoreOverlayScrollbarHiding ? _strEmpty : _overlayScrollbarDummySize.y;
|
contentElementCSS[_strBorderMinus + isRTLLeft] = (/* !widthAuto && */ !ignoreOverlayScrollbarHiding) ? (_overlayScrollbarDummySize.y + borderDesign) : _strEmpty;
|
||||||
if (/* !widthAuto && */ !ignoreOverlayScrollbarHiding)
|
|
||||||
contentElementCSS[_strBorderMinus + isRTLLeft] = _overlayScrollbarDummySize.y + borderDesign;
|
|
||||||
else
|
|
||||||
contentElementCSS[_strBorderMinus + isRTLLeft] = _strEmpty;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
arrangeContent.w = _strEmpty;
|
arrangeContent.w =
|
||||||
arrangeChanged = true;
|
contentElementCSS[_strMarginMinus + isRTLLeft] =
|
||||||
contentElementCSS[_strBorderMinus + isRTLLeft] = _strEmpty;
|
contentElementCSS[_strBorderMinus + isRTLLeft] = _strEmpty;
|
||||||
contentElementCSS[_strMarginMinus + isRTLLeft] = _strEmpty;
|
arrangeChanged = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ignoreOverlayScrollbarHiding) {
|
if (ignoreOverlayScrollbarHiding) {
|
||||||
arrangeContent.w = _strEmpty;
|
arrangeContent.w = arrangeContent.h = _strEmpty;
|
||||||
arrangeContent.h = _strEmpty;
|
|
||||||
arrangeChanged = true;
|
arrangeChanged = true;
|
||||||
}
|
}
|
||||||
if (arrangeChanged) {
|
if (arrangeChanged) {
|
||||||
var contentArrangeElementCSS = { };
|
|
||||||
contentArrangeElementCSS[_strWidth] = hideOverflow.y ? arrangeContent.w : _strEmpty;
|
contentArrangeElementCSS[_strWidth] = hideOverflow.y ? arrangeContent.w : _strEmpty;
|
||||||
contentArrangeElementCSS[_strHeight] = hideOverflow.x ? arrangeContent.h : _strEmpty;
|
contentArrangeElementCSS[_strHeight] = hideOverflow.x ? arrangeContent.h : _strEmpty;
|
||||||
|
|
||||||
@@ -2756,20 +2743,19 @@
|
|||||||
viewportElementCSS[_strMarginMinus + isRTLRight] = -_nativeScrollbarMinSize.y;
|
viewportElementCSS[_strMarginMinus + isRTLRight] = -_nativeScrollbarMinSize.y;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
viewportElementCSS[_strPaddingMinus + _strTop] = _strEmpty;
|
viewportElementCSS[_strPaddingMinus + _strTop] =
|
||||||
viewportElementCSS[_strMarginMinus + _strTop] = _strEmpty;
|
viewportElementCSS[_strMarginMinus + _strTop] =
|
||||||
|
viewportElementCSS[_strPaddingMinus + isRTLRight] =
|
||||||
viewportElementCSS[_strPaddingMinus + isRTLRight] = _strEmpty;
|
|
||||||
viewportElementCSS[_strMarginMinus + isRTLRight] = _strEmpty;
|
viewportElementCSS[_strMarginMinus + isRTLRight] = _strEmpty;
|
||||||
}
|
}
|
||||||
viewportElementCSS[_strPaddingMinus + isRTLLeft] = _strEmpty;
|
viewportElementCSS[_strPaddingMinus + isRTLLeft] =
|
||||||
viewportElementCSS[_strMarginMinus + isRTLLeft] = _strEmpty;
|
viewportElementCSS[_strMarginMinus + isRTLLeft] = _strEmpty;
|
||||||
|
|
||||||
//if there is any overflow (x OR y axis) and this overflow shall be hidden, make overflow hidden, else overflow visible
|
//if there is any overflow (x OR y axis) and this overflow shall be hidden, make overflow hidden, else overflow visible
|
||||||
if ((hasOverflow.x && hideOverflow.x) || (hasOverflow.y && hideOverflow.y) || hideOverflowForceTextarea) {
|
if ((hasOverflow.x && hideOverflow.x) || (hasOverflow.y && hideOverflow.y) || hideOverflowForceTextarea) {
|
||||||
//only hide if is Textarea
|
//only hide if is Textarea
|
||||||
if (_isTextarea && hideOverflowForceTextarea) {
|
if (_isTextarea && hideOverflowForceTextarea) {
|
||||||
paddingElementCSS[strOverflowX] = strHidden;
|
paddingElementCSS[strOverflowX] =
|
||||||
paddingElementCSS[strOverflowY] = strHidden;
|
paddingElementCSS[strOverflowY] = strHidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2777,10 +2763,10 @@
|
|||||||
if (!clipAlways || (overflowBehaviorIsVH.x || overflowBehaviorIsVS.x || overflowBehaviorIsVH.y || overflowBehaviorIsVS.y)) {
|
if (!clipAlways || (overflowBehaviorIsVH.x || overflowBehaviorIsVS.x || overflowBehaviorIsVH.y || overflowBehaviorIsVS.y)) {
|
||||||
//only un-hide if Textarea
|
//only un-hide if Textarea
|
||||||
if (_isTextarea) {
|
if (_isTextarea) {
|
||||||
paddingElementCSS[strOverflowX] = _strEmpty;
|
paddingElementCSS[strOverflowX] =
|
||||||
paddingElementCSS[strOverflowY] = _strEmpty;
|
paddingElementCSS[strOverflowY] = _strEmpty;
|
||||||
}
|
}
|
||||||
viewportElementCSS[strOverflowX] = strVisible;
|
viewportElementCSS[strOverflowX] =
|
||||||
viewportElementCSS[strOverflowY] = strVisible;
|
viewportElementCSS[strOverflowY] = strVisible;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4345,6 +4331,7 @@
|
|||||||
else
|
else
|
||||||
margin = marginDefault;
|
margin = marginDefault;
|
||||||
|
|
||||||
|
//block = type(block) === TYPES.b ? block ? [ strNearest, strBegin ] : [ strNearest, strEnd ] : block;
|
||||||
settingsAxis = checkSettingsStringValue(axis, elementObjSettingsAxisValues) ? axis : 'xy';
|
settingsAxis = checkSettingsStringValue(axis, elementObjSettingsAxisValues) ? axis : 'xy';
|
||||||
settingsScroll = getPerAxisValue(scroll, TYPES.s, strAlways, elementObjSettingsScrollValues);
|
settingsScroll = getPerAxisValue(scroll, TYPES.s, strAlways, elementObjSettingsScrollValues);
|
||||||
settingsBlock = getPerAxisValue(block, TYPES.s, strBegin, elementObjSettingsBlockValues);
|
settingsBlock = getPerAxisValue(block, TYPES.s, strBegin, elementObjSettingsBlockValues);
|
||||||
@@ -4377,7 +4364,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
//measuring is required
|
//measuring is required
|
||||||
if (settingsBlock.x != strBegin || settingsBlock.y != strBegin || settingsScroll.x == strIfNeeded || settingsScroll.y == strIfNeeded) {
|
if (settingsBlock.x != strBegin || settingsBlock.y != strBegin || settingsScroll.x == strIfNeeded || settingsScroll.y == strIfNeeded || _isRTL) {
|
||||||
var measuringElm = finalElement[0];
|
var measuringElm = finalElement[0];
|
||||||
var rawElementSize = {};
|
var rawElementSize = {};
|
||||||
var rect;
|
var rect;
|
||||||
@@ -4764,6 +4751,7 @@
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
var doUpdate = false;
|
var doUpdate = false;
|
||||||
|
//var doUpdateScrollbars = false;
|
||||||
var mutation;
|
var mutation;
|
||||||
framework.each(mutations, function () {
|
framework.each(mutations, function () {
|
||||||
mutation = this;
|
mutation = this;
|
||||||
@@ -4783,6 +4771,14 @@
|
|||||||
|
|
||||||
if (doUpdate)
|
if (doUpdate)
|
||||||
_base.update(_strAuto);
|
_base.update(_strAuto);
|
||||||
|
/*
|
||||||
|
if(doUpdateScrollbars) {
|
||||||
|
refreshScrollbarHandleLength(true);
|
||||||
|
refreshScrollbarHandleOffset(true, _scrollHorizontalInfo.cs);
|
||||||
|
refreshScrollbarHandleLength(false);
|
||||||
|
refreshScrollbarHandleOffset(false, _scrollVerticalInfo.cs);
|
||||||
|
}
|
||||||
|
*/
|
||||||
});
|
});
|
||||||
_mutationObserverContent = new mutationObserver(function (mutations) {
|
_mutationObserverContent = new mutationObserver(function (mutations) {
|
||||||
if (!_initialized || _isSleeping)
|
if (!_initialized || _isSleeping)
|
||||||
|
|||||||
Vendored
+3
-3
File diff suppressed because one or more lines are too long
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "overlayscrollbars",
|
"name": "overlayscrollbars",
|
||||||
"version": "1.5.0",
|
"version": "1.5.1",
|
||||||
"description": "A javascript scrollbar plugin which hides the native scrollbars and provides custom styleable overlay scrollbars, but keeps the native functionality and feeling.",
|
"description": "A javascript scrollbar plugin which hides the native scrollbars and provides custom styleable overlay scrollbars, but keeps the native functionality and feeling.",
|
||||||
"keywords" : [
|
"keywords" : [
|
||||||
"overlayscrollbars",
|
"overlayscrollbars",
|
||||||
|
|||||||
Reference in New Issue
Block a user