fix scrollMax overflow bug in new Firefox

This commit is contained in:
Haas Rene
2019-12-30 11:25:25 +01:00
parent b94f6894bc
commit 2f47e8aefc
7 changed files with 23 additions and 21 deletions
+2 -2
View File
@@ -2,13 +2,13 @@
* OverlayScrollbars
* https://github.com/KingSora/OverlayScrollbars
*
* Version: 1.10.0
* Version: 1.10.1
*
* Copyright KingSora | Rene Haas.
* https://github.com/KingSora
*
* Released under the MIT license.
* Date: 11.10.2019
* Date: 30.12.2019
*/
/*
+2 -2
View File
File diff suppressed because one or more lines are too long
+5 -4
View File
@@ -2,13 +2,13 @@
* OverlayScrollbars
* https://github.com/KingSora/OverlayScrollbars
*
* Version: 1.10.0
* Version: 1.10.1
*
* Copyright KingSora | Rene Haas.
* https://github.com/KingSora
*
* Released under the MIT license.
* Date: 11.10.2019
* Date: 30.12.2019
*/
(function (global, factory) {
@@ -3772,13 +3772,14 @@
var xy = scrollbarVars._x_y;
var wh = scrollbarVars._w_h;
var widthHeight = scrollbarVars._width_height;
var scrollMax = _strScroll + scrollbarVars._Left_Top + 'Max';
var scrollMax = _strScroll + scrollbarVars._Left_Top + 'Max';
var fractionalOverflowAmount = viewportRect[widthHeight] ? MATH.abs(viewportRect[widthHeight] - _viewportSize[wh]) : 0;
var checkFractionalOverflowAmount = previousOverflowAmount && previousOverflowAmount[xy] > 0 && _viewportElementNative[scrollMax] === 0;
overflowBehaviorIsVS[xy] = overflowBehavior[xy] === 'v-s';
overflowBehaviorIsVH[xy] = overflowBehavior[xy] === 'v-h';
overflowBehaviorIsS[xy] = overflowBehavior[xy] === 's';
overflowAmount[xy] = MATH.max(0, MATH.round((contentScrollSize[wh] - _viewportSize[wh]) * 100) / 100);
overflowAmount[xy] *= (hideOverflowForceTextarea || (_viewportElementNative[scrollMax] === 0 && fractionalOverflowAmount > 0 && fractionalOverflowAmount < 1)) ? 0 : 1;
overflowAmount[xy] *= (hideOverflowForceTextarea || (checkFractionalOverflowAmount && fractionalOverflowAmount > 0 && fractionalOverflowAmount < 1)) ? 0 : 1;
hasOverflow[xy] = overflowAmount[xy] > 0;
//hideOverflow:
+3 -3
View File
File diff suppressed because one or more lines are too long
+7 -6
View File
@@ -2,13 +2,13 @@
* OverlayScrollbars
* https://github.com/KingSora/OverlayScrollbars
*
* Version: 1.10.0
* Version: 1.10.1
*
* Copyright KingSora | Rene Haas.
* https://github.com/KingSora
*
* Released under the MIT license.
* Date: 11.10.2019
* Date: 30.12.2019
*/
(function (global, factory) {
@@ -2674,7 +2674,7 @@
_hostSizeCache = hostSize;
var hideOverflowForceTextarea = _isTextarea && (_viewportSize.w === 0 || _viewportSize.h === 0);
var previousOverflow = _overflowAmountCache;
var previousOverflowAmount = _overflowAmountCache;
var overflowBehaviorIsVS = { };
var overflowBehaviorIsVH = { };
var overflowBehaviorIsS = { };
@@ -2690,13 +2690,14 @@
var xy = scrollbarVars._x_y;
var wh = scrollbarVars._w_h;
var widthHeight = scrollbarVars._width_height;
var scrollMax = _strScroll + scrollbarVars._Left_Top + 'Max';
var scrollMax = _strScroll + scrollbarVars._Left_Top + 'Max';
var fractionalOverflowAmount = viewportRect[widthHeight] ? MATH.abs(viewportRect[widthHeight] - _viewportSize[wh]) : 0;
var checkFractionalOverflowAmount = previousOverflowAmount && previousOverflowAmount[xy] > 0 && _viewportElementNative[scrollMax] === 0;
overflowBehaviorIsVS[xy] = overflowBehavior[xy] === 'v-s';
overflowBehaviorIsVH[xy] = overflowBehavior[xy] === 'v-h';
overflowBehaviorIsS[xy] = overflowBehavior[xy] === 's';
overflowAmount[xy] = MATH.max(0, MATH.round((contentScrollSize[wh] - _viewportSize[wh]) * 100) / 100);
overflowAmount[xy] *= (hideOverflowForceTextarea || (_viewportElementNative[scrollMax] === 0 && fractionalOverflowAmount > 0 && fractionalOverflowAmount < 1)) ? 0 : 1;
overflowAmount[xy] *= (hideOverflowForceTextarea || (checkFractionalOverflowAmount && fractionalOverflowAmount > 0 && fractionalOverflowAmount < 1)) ? 0 : 1;
hasOverflow[xy] = overflowAmount[xy] > 0;
//hideOverflow:
@@ -2915,7 +2916,7 @@
var cursorIsLastPosition = (cursorPos >= cursorMax && _textareaHasFocus);
var textareaScrollAmount = {
x: (!textareaAutoWrapping && (cursorCol === lastCol && cursorRow === widestRow)) ? _overflowAmountCache.x : -1,
y: (textareaAutoWrapping ? cursorIsLastPosition || textareaRowsChanged && (previousOverflow !== undefined ? (currScroll.y === previousOverflow.y) : false) : (cursorIsLastPosition || textareaRowsChanged) && cursorRow === lastRow) ? _overflowAmountCache.y : -1
y: (textareaAutoWrapping ? cursorIsLastPosition || textareaRowsChanged && (previousOverflowAmount ? (currScroll.y === previousOverflowAmount.y) : false) : (cursorIsLastPosition || textareaRowsChanged) && cursorRow === lastRow) ? _overflowAmountCache.y : -1
};
currScroll.x = textareaScrollAmount.x > -1 ? (_isRTL && _normalizeRTLCache && _rtlScrollBehavior.i ? 0 : textareaScrollAmount.x) : currScroll.x; //if inverted, scroll to 0 -> normalized this means to max scroll offset.
currScroll.y = textareaScrollAmount.y > -1 ? textareaScrollAmount.y : currScroll.y;
+3 -3
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "overlayscrollbars",
"version": "1.9.1",
"version": "1.10.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {