From 7b57bc7d9293bbd4d35e25b12bde084e6e02c071 Mon Sep 17 00:00:00 2001 From: Rene Date: Sun, 2 Feb 2020 20:04:26 +0100 Subject: [PATCH] version 1.10.3 --- css/OverlayScrollbars.css | 4 +- css/OverlayScrollbars.min.css | 4 +- js/OverlayScrollbars.js | 12 +- js/OverlayScrollbars.min.js | 6 +- js/jquery.overlayScrollbars.js | 1088 ++++++++++++++-------------- js/jquery.overlayScrollbars.min.js | 6 +- package.json | 2 +- 7 files changed, 565 insertions(+), 557 deletions(-) diff --git a/css/OverlayScrollbars.css b/css/OverlayScrollbars.css index 19840ed2..2563d93e 100644 --- a/css/OverlayScrollbars.css +++ b/css/OverlayScrollbars.css @@ -2,13 +2,13 @@ * OverlayScrollbars * https://github.com/KingSora/OverlayScrollbars * - * Version: 1.10.2 + * Version: 1.10.3 * * Copyright KingSora | Rene Haas. * https://github.com/KingSora * * Released under the MIT license. - * Date: 30.12.2019 + * Date: 02.02.2020 */ /* diff --git a/css/OverlayScrollbars.min.css b/css/OverlayScrollbars.min.css index 61988942..07db423a 100644 --- a/css/OverlayScrollbars.min.css +++ b/css/OverlayScrollbars.min.css @@ -2,12 +2,12 @@ * OverlayScrollbars * https://github.com/KingSora/OverlayScrollbars * - * Version: 1.10.2 + * Version: 1.10.3 * * Copyright KingSora | Rene Haas. * https://github.com/KingSora * * Released under the MIT license. - * Date: 30.12.2019 + * Date: 02.02.2020 */ html.os-html,html.os-html>.os-host{display:block;overflow:hidden;box-sizing:border-box;height:100%!important;width:100%!important;min-width:100%!important;min-height:100%!important;margin:0!important;position:absolute!important}html.os-html>.os-host>.os-padding{position:absolute}body.os-dragging,body.os-dragging *{cursor:default}.os-host,.os-host-textarea{position:relative;overflow:visible!important;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-wrap:nowrap;flex-wrap:nowrap;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start;-ms-flex-line-pack:start;align-content:flex-start;-webkit-box-align:start;-ms-flex-align:start;-ms-grid-row-align:flex-start;align-items:flex-start}.os-host-flexbox{overflow:hidden!important;display:-webkit-box;display:-ms-flexbox;display:flex}.os-host-flexbox>.os-size-auto-observer{height:inherit!important}.os-host-flexbox>.os-content-glue{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1;-ms-flex-negative:0;flex-shrink:0}.os-host-flexbox>.os-size-auto-observer,.os-host-flexbox>.os-content-glue{min-height:0;min-width:0;-webkit-box-flex:0;-ms-flex-positive:0;flex-grow:0;-ms-flex-negative:1;flex-shrink:1;-ms-flex-preferred-size:auto;flex-basis:auto}#os-dummy-scrollbar-size{position:fixed;opacity:0;-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=0)';visibility:hidden;overflow:scroll;height:500px;width:500px}#os-dummy-scrollbar-size>div{width:200%;height:200%;margin:10px 0}#os-dummy-scrollbar-size,.os-viewport{-ms-overflow-style:scrollbar!important}.os-viewport-native-scrollbars-invisible#os-dummy-scrollbar-size,.os-viewport-native-scrollbars-invisible.os-viewport{scrollbar-width:none!important}.os-viewport-native-scrollbars-invisible#os-dummy-scrollbar-size::-webkit-scrollbar,.os-viewport-native-scrollbars-invisible.os-viewport::-webkit-scrollbar,.os-viewport-native-scrollbars-invisible#os-dummy-scrollbar-size::-webkit-scrollbar-corner,.os-viewport-native-scrollbars-invisible.os-viewport::-webkit-scrollbar-corner{display:none!important;width:0!important;height:0!important;visibility:hidden!important;background:0 0!important}.os-content-glue{box-sizing:inherit;max-height:100%;max-width:100%;width:100%;pointer-events:none}.os-padding{box-sizing:inherit;direction:inherit;position:absolute;overflow:visible;padding:0;margin:0;left:0;top:0;bottom:0;right:0;width:auto!important;height:auto!important;z-index:1}.os-host-overflow>.os-padding{overflow:hidden}.os-viewport{direction:inherit!important;box-sizing:inherit!important;resize:none!important;outline:0!important;position:absolute;overflow:hidden;top:0;left:0;bottom:0;right:0;padding:0;margin:0;-webkit-overflow-scrolling:touch}.os-content-arrange{position:absolute;z-index:-1;min-height:1px;min-width:1px;pointer-events:none}.os-content{direction:inherit;box-sizing:border-box!important;position:relative;display:block;height:100%;width:100%;height:100%;width:100%;visibility:visible}.os-content:before,.os-content:after{content:'';display:table;width:0;height:0;line-height:0;font-size:0}.os-content>.os-textarea{box-sizing:border-box!important;direction:inherit!important;background:0 0!important;outline:0 transparent!important;overflow:hidden!important;position:absolute!important;display:block!important;top:0!important;left:0!important;margin:0!important;border-radius:0!important;float:none!important;-webkit-filter:none!important;filter:none!important;border:0!important;resize:none!important;-webkit-transform:none!important;transform:none!important;max-width:none!important;max-height:none!important;box-shadow:none!important;-webkit-perspective:none!important;perspective:none!important;opacity:1!important;z-index:1!important;clip:auto!important;vertical-align:baseline!important;padding:0}.os-host-rtl>.os-padding>.os-viewport>.os-content>.os-textarea{right:0!important}.os-content>.os-textarea-cover{z-index:-1;pointer-events:none}.os-content>.os-textarea[wrap=off]{white-space:pre!important;margin:0!important}.os-text-inherit{font-family:inherit;font-size:inherit;font-weight:inherit;font-style:inherit;font-variant:inherit;text-transform:inherit;text-decoration:inherit;text-indent:inherit;text-align:inherit;text-shadow:inherit;text-overflow:inherit;letter-spacing:inherit;word-spacing:inherit;line-height:inherit;unicode-bidi:inherit;direction:inherit;color:inherit;cursor:text}.os-resize-observer,.os-resize-observer-host{box-sizing:inherit;display:block;opacity:0;position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden;pointer-events:none;z-index:-1}.os-resize-observer-host{padding:inherit;border:inherit;border-color:transparent;border-style:solid;box-sizing:border-box}.os-resize-observer-host:after{content:''}.os-resize-observer-host>.os-resize-observer,.os-resize-observer-host:after{height:200%;width:200%;padding:inherit;border:inherit;margin:0;display:block;box-sizing:content-box}.os-resize-observer.observed,object.os-resize-observer{box-sizing:border-box!important}.os-size-auto-observer{box-sizing:inherit!important;height:100%;width:inherit;max-width:1px;position:relative;float:left;max-height:1px;overflow:hidden;z-index:-1;padding:0;margin:0;pointer-events:none;-webkit-box-flex:inherit;-ms-flex-positive:inherit;flex-grow:inherit;-ms-flex-negative:0;flex-shrink:0;-ms-flex-preferred-size:0;flex-basis:0}.os-size-auto-observer>.os-resize-observer{width:1000%;height:1000%;min-height:1px;min-width:1px}.os-resize-observer-item{position:absolute;top:0;right:0;bottom:0;left:0;overflow:hidden;z-index:-1;opacity:0;direction:ltr!important;-webkit-box-flex:0!important;-ms-flex:none!important;flex:none!important}.os-resize-observer-item-final{position:absolute;left:0;top:0;-webkit-transition:none!important;transition:none!important;-webkit-box-flex:0!important;-ms-flex:none!important;flex:none!important}.os-resize-observer{-webkit-animation-duration:.001s;animation-duration:.001s;-webkit-animation-name:hs-resize-observer-dummy-animation;animation-name:hs-resize-observer-dummy-animation}.os-host-transition>.os-scrollbar,.os-host-transition>.os-scrollbar-corner{-webkit-transition:opacity .3s,visibility .3s,top .3s,right .3s,bottom .3s,left .3s;transition:opacity .3s,visibility .3s,top .3s,right .3s,bottom .3s,left .3s}html.os-html>.os-host>.os-scrollbar{position:absolute;z-index:999999}.os-scrollbar,.os-scrollbar-corner{position:absolute;opacity:1;-ms-filter:'progid:DXImageTransform.Microsoft.Alpha(Opacity=100)';z-index:1}.os-scrollbar-corner{bottom:0;right:0}.os-scrollbar{pointer-events:none}.os-scrollbar-track{pointer-events:auto;position:relative;height:100%;width:100%;padding:0!important;border:0!important}.os-scrollbar-handle{pointer-events:auto;position:absolute;width:100%;height:100%}.os-scrollbar-handle-off,.os-scrollbar-track-off{pointer-events:none}.os-scrollbar.os-scrollbar-unusable,.os-scrollbar.os-scrollbar-unusable *{pointer-events:none!important}.os-scrollbar.os-scrollbar-unusable .os-scrollbar-handle{opacity:0!important}.os-scrollbar-horizontal{bottom:0;left:0}.os-scrollbar-vertical{top:0;right:0}.os-host-rtl>.os-scrollbar-horizontal{right:0}.os-host-rtl>.os-scrollbar-vertical{right:auto;left:0}.os-host-rtl>.os-scrollbar-corner{right:auto;left:0}.os-scrollbar-auto-hidden,.os-padding+.os-scrollbar-corner,.os-host-resize-disabled.os-host-scrollbar-horizontal-hidden>.os-scrollbar-corner,.os-host-scrollbar-horizontal-hidden>.os-scrollbar-horizontal,.os-host-resize-disabled.os-host-scrollbar-vertical-hidden>.os-scrollbar-corner,.os-host-scrollbar-vertical-hidden>.os-scrollbar-vertical,.os-scrollbar-horizontal.os-scrollbar-auto-hidden+.os-scrollbar-vertical+.os-scrollbar-corner,.os-scrollbar-horizontal+.os-scrollbar-vertical.os-scrollbar-auto-hidden+.os-scrollbar-corner,.os-scrollbar-horizontal.os-scrollbar-auto-hidden+.os-scrollbar-vertical.os-scrollbar-auto-hidden+.os-scrollbar-corner{opacity:0;visibility:hidden;pointer-events:none}.os-scrollbar-corner-resize-both{cursor:nwse-resize}.os-host-rtl>.os-scrollbar-corner-resize-both{cursor:nesw-resize}.os-scrollbar-corner-resize-horizontal{cursor:ew-resize}.os-scrollbar-corner-resize-vertical{cursor:ns-resize}.os-dragging .os-scrollbar-corner.os-scrollbar-corner-resize{cursor:default}.os-host-resize-disabled.os-host-scrollbar-horizontal-hidden>.os-scrollbar-vertical{top:0;bottom:0}.os-host-resize-disabled.os-host-scrollbar-vertical-hidden>.os-scrollbar-horizontal,.os-host-rtl.os-host-resize-disabled.os-host-scrollbar-vertical-hidden>.os-scrollbar-horizontal{right:0;left:0}.os-scrollbar:hover,.os-scrollbar-corner.os-scrollbar-corner-resize{opacity:1!important;visibility:visible!important}.os-scrollbar-corner.os-scrollbar-corner-resize{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+PHN2ZyAgIHhtbG5zOmRjPSJodHRwOi8vcHVybC5vcmcvZGMvZWxlbWVudHMvMS4xLyIgICB4bWxuczpjYz0iaHR0cDovL2NyZWF0aXZlY29tbW9ucy5vcmcvbnMjIiAgIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIgICB4bWxuczpzdmc9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgICB3aWR0aD0iMTAiICAgaGVpZ2h0PSIxMCIgICB2ZXJzaW9uPSIxLjEiPiAgPGcgICAgIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAsLTEwNDIuMzYyMikiICAgICBzdHlsZT0iZGlzcGxheTppbmxpbmUiPiAgICA8cGF0aCAgICAgICBzdHlsZT0iZmlsbDojMDAwMDAwO2ZpbGwtb3BhY2l0eTowLjQ5NDExNzY1O2ZpbGwtcnVsZTpldmVub2RkO3N0cm9rZTpub25lIiAgICAgICBkPSJtIDcuNDI0MjE4NywxMDQyLjM2MjIgYyAtMC43MjM1NzkyLDAgLTEuMzEwMTU2MiwwLjU4NjYgLTEuMzEwMTU2MiwxLjMxMDIgMCwwLjI5OSAwLjEwNDM0MTksMC41NzEgMC4yNzI5NDkyLDAuNzkxNSAwLjIwOTEwMjQsMC4xNDEzIDAuNDY1NjIwNiwwLjIxODQgMC43MzY5NjI5LDAuMjE4NCAwLjcyMzU3OTMsMCAxLjMxMDE1NjMsLTAuNTg2NiAxLjMxMDE1NjMsLTEuMzEwMiAwLC0wLjI3MTMgLTAuMDc3MDkzLC0wLjUyNzggLTAuMjE4MzU5NCwtMC43MzcgLTAuMjIwNDk0MSwtMC4xNjg2IC0wLjQ5MjU0NDMsLTAuMjcyOSAtMC43OTE1NTI4LC0wLjI3MjkgeiBtIDAsMy4wODQzIGMgLTAuNzIzNTc5MiwwIC0xLjMxMDE1NjIsMC41ODY2IC0xLjMxMDE1NjIsMS4zMTAyIDAsMC4yOTkgMC4xMDQzNDE5LDAuNTcxIDAuMjcyOTQ5MiwwLjc5MTUgMC4yMDkxMDI0LDAuMTQxMyAwLjQ2NTYyMDYsMC4yMTg0IDAuNzM2OTYyOSwwLjIxODQgMC43MjM1NzkzLDAgMS4zMTAxNTYzLC0wLjU4NjYgMS4zMTAxNTYzLC0xLjMxMDIgMCwtMC4yNzEzIC0wLjA3NzA5MywtMC41Mjc4IC0wLjIxODM1OTQsLTAuNzM2OSAtMC4yMjA0OTQxLC0wLjE2ODYgLTAuNDkyNTQ0MywtMC4yNzMgLTAuNzkxNTUyOCwtMC4yNzMgeiBtIC0zLjA4NDMyNjEsMCBjIC0wLjcyMzU3OTMsMCAtMS4zMTAxNTYzLDAuNTg2NiAtMS4zMTAxNTYzLDEuMzEwMiAwLDAuMjk5IDAuMTA0MzQxOSwwLjU3MSAwLjI3Mjk0OTIsMC43OTE1IDAuMjA5MTAyNCwwLjE0MTMgMC40NjU2MjA3LDAuMjE4NCAwLjczNjk2MjksMC4yMTg0IDAuNzIzNTc5MywwIDEuMzEwMTU2MywtMC41ODY2IDEuMzEwMTU2MywtMS4zMTAyIDAsLTAuMjcxMyAtMC4wNzcwOTMsLTAuNTI3OCAtMC4yMTgzNTk0LC0wLjczNjkgLTAuMjIwNDk0LC0wLjE2ODYgLTAuNDkyNTQ0MiwtMC4yNzMgLTAuNzkxNTUyNywtMC4yNzMgeiBtIC0zLjAyOTczNjQsMy4wMjk4IEMgMC41ODY1NzY5MywxMDQ4LjQ3NjMgMCwxMDQ5LjA2MjggMCwxMDQ5Ljc4NjQgYyAwLDAuMjk5IDAuMTA0MzQxOSwwLjU3MTEgMC4yNzI5NDkyMiwwLjc5MTYgMC4yMDkxMDIyOSwwLjE0MTIgMC40NjU2MjA2NSwwLjIxODMgMC43MzY5NjI4OCwwLjIxODMgMC43MjM1NzkzLDAgMS4zMTAxNTYzLC0wLjU4NjUgMS4zMTAxNTYzLC0xLjMxMDEgMCwtMC4yNzE0IC0wLjA3NzA5MywtMC41Mjc5IC0wLjIxODM1OTQsLTAuNzM3IC0wLjIyMDQ5NDEsLTAuMTY4NiAtMC40OTI1NDQzLC0wLjI3MjkgLTAuNzkxNTUyOCwtMC4yNzI5IHogbSAzLjAyOTczNjQsMCBjIC0wLjcyMzU3OTMsMCAtMS4zMTAxNTYzLDAuNTg2NSAtMS4zMTAxNTYzLDEuMzEwMSAwLDAuMjk5IDAuMTA0MzQxOSwwLjU3MTEgMC4yNzI5NDkyLDAuNzkxNiAwLjIwOTEwMjQsMC4xNDEyIDAuNDY1NjIwNywwLjIxODMgMC43MzY5NjI5LDAuMjE4MyAwLjcyMzU3OTMsMCAxLjMxMDE1NjMsLTAuNTg2NSAxLjMxMDE1NjMsLTEuMzEwMSAwLC0wLjI3MTQgLTAuMDc3MDkzLC0wLjUyNzkgLTAuMjE4MzU5NCwtMC43MzcgLTAuMjIwNDk0LC0wLjE2ODYgLTAuNDkyNTQ0MiwtMC4yNzI5IC0wLjc5MTU1MjcsLTAuMjcyOSB6IG0gMy4wODQzMjYxLDAgYyAtMC43MjM1NzkyLDAgLTEuMzEwMTU2MiwwLjU4NjUgLTEuMzEwMTU2MiwxLjMxMDEgMCwwLjI5OSAwLjEwNDM0MTksMC41NzExIDAuMjcyOTQ5MiwwLjc5MTYgMC4yMDkxMDI0LDAuMTQxMiAwLjQ2NTYyMDYsMC4yMTgzIDAuNzM2OTYyOSwwLjIxODMgMC43MjM1NzkzLDAgMS4zMTAxNTYzLC0wLjU4NjUgMS4zMTAxNTYzLC0xLjMxMDEgMCwtMC4yNzE0IC0wLjA3NzA5MywtMC41Mjc5IC0wLjIxODM1OTQsLTAuNzM3IC0wLjIyMDQ5NDEsLTAuMTY4NiAtMC40OTI1NDQzLC0wLjI3MjkgLTAuNzkxNTUyOCwtMC4yNzI5IHoiLz4gIDwvZz4gIDxnICAgICBzdHlsZT0iZGlzcGxheTppbmxpbmUiPiAgICA8cGF0aCAgICAgICBzdHlsZT0iZmlsbDojZmZmZmZmO2ZpbGwtb3BhY2l0eToxO2ZpbGwtcnVsZTpldmVub2RkO3N0cm9rZTpub25lIiAgICAgICBkPSJtIDguMjE1NzcxNSwwLjI3Mjk0OTIyIGMgMC4xNDEyNjY3LDAuMjA5MTAyMjkgMC4yMTgzNTk0LDAuNDY1NjIwNjUgMC4yMTgzNTk0LDAuNzM2OTYyODggMCwwLjcyMzU3OTMgLTAuNTg2NTc3LDEuMzEwMTU2MyAtMS4zMTAxNTYzLDEuMzEwMTU2MyAtMC4yNzEzNDIzLDAgLTAuNTI3ODYwNSwtMC4wNzcwOTMgLTAuNzM2OTYyOSwtMC4yMTgzNTk0IDAuMjM5NDEwNCwwLjMxMzA4NTkgMC42MTI2MzYyLDAuNTE4NjAzNSAxLjAzNzIwNywwLjUxODYwMzUgMC43MjM1NzkzLDAgMS4zMTAxNTYzLC0wLjU4NjU3NyAxLjMxMDE1NjMsLTEuMzEwMTU2MyAwLC0wLjQyNDU3MDc2IC0wLjIwNTUxNzYsLTAuNzk3Nzk2NTkgLTAuNTE4NjAzNSwtMS4wMzcyMDY5OCB6IG0gMCwzLjA4NDMyNjE4IGMgMC4xNDEyNjY3LDAuMjA5MTAyMyAwLjIxODM1OTQsMC40NjU2MjA2IDAuMjE4MzU5NCwwLjczNjk2MjkgMCwwLjcyMzU3OTMgLTAuNTg2NTc3LDEuMzEwMTU2MiAtMS4zMTAxNTYzLDEuMzEwMTU2MiAtMC4yNzEzNDIzLDAgLTAuNTI3ODYwNSwtMC4wNzcwOTMgLTAuNzM2OTYyOSwtMC4yMTgzNTkzIDAuMjM5NDEwNCwwLjMxMzA4NTkgMC42MTI2MzYyLDAuNTE4NjAzNSAxLjAzNzIwNywwLjUxODYwMzUgMC43MjM1NzkzLDAgMS4zMTAxNTYzLC0wLjU4NjU3NyAxLjMxMDE1NjMsLTEuMzEwMTU2MyAwLC0wLjQyNDU3MDggLTAuMjA1NTE3NiwtMC43OTc3OTY3IC0wLjUxODYwMzUsLTEuMDM3MjA3IHogbSAtMy4wODQzMjYyLDAgYyAwLjE0MTI2NjcsMC4yMDkxMDIzIDAuMjE4MzU5NCwwLjQ2NTYyMDYgMC4yMTgzNTk0LDAuNzM2OTYyOSAwLDAuNzIzNTc5MyAtMC41ODY1NzcsMS4zMTAxNTYyIC0xLjMxMDE1NjMsMS4zMTAxNTYyIC0wLjI3MTM0MjIsMCAtMC41Mjc4NjA1LC0wLjA3NzA5MyAtMC43MzY5NjI5LC0wLjIxODM1OTMgMC4yMzk0MTA0LDAuMzEzMDg1OSAwLjYxMjYzNjMsMC41MTg2MDM1IDEuMDM3MjA3MSwwLjUxODYwMzUgMC43MjM1NzkzLDAgMS4zMTAxNTYyLC0wLjU4NjU3NyAxLjMxMDE1NjIsLTEuMzEwMTU2MyAwLC0wLjQyNDU3MDggLTAuMjA1NTE3NSwtMC43OTc3OTY3IC0wLjUxODYwMzUsLTEuMDM3MjA3IHogTSAyLjEwMTcwOSw2LjM4NzAxMTcgYyAwLjE0MTI2NjcsMC4yMDkxMDI0IDAuMjE4MzU5NCwwLjQ2NTYyMDYgMC4yMTgzNTk0LDAuNzM2OTYyOSAwLDAuNzIzNTc5MyAtMC41ODY1NzcsMS4zMTAxNTYzIC0xLjMxMDE1NjMsMS4zMTAxNTYzIC0wLjI3MTM0MjIzLDAgLTAuNTI3ODYwNTksLTAuMDc3MDkzIC0wLjczNjk2Mjg4LC0wLjIxODM1OTQgMC4yMzk0MTAzOSwwLjMxMzA4NTkgMC42MTI2MzYyMiwwLjUxODYwMzUgMS4wMzcyMDY5OCwwLjUxODYwMzUgMC43MjM1NzkzLDAgMS4zMTAxNTYzLC0wLjU4NjU3NyAxLjMxMDE1NjMsLTEuMzEwMTU2MyAwLC0wLjQyNDU3MDggLTAuMjA1NTE3NiwtMC43OTc3OTY2IC0wLjUxODYwMzUsLTEuMDM3MjA3IHogbSAzLjAyOTczNjMsMCBjIDAuMTQxMjY2NywwLjIwOTEwMjQgMC4yMTgzNTk0LDAuNDY1NjIwNiAwLjIxODM1OTQsMC43MzY5NjI5IDAsMC43MjM1NzkzIC0wLjU4NjU3NywxLjMxMDE1NjMgLTEuMzEwMTU2MywxLjMxMDE1NjMgLTAuMjcxMzQyMiwwIC0wLjUyNzg2MDUsLTAuMDc3MDkzIC0wLjczNjk2MjksLTAuMjE4MzU5NCAwLjIzOTQxMDQsMC4zMTMwODU5IDAuNjEyNjM2MywwLjUxODYwMzUgMS4wMzcyMDcxLDAuNTE4NjAzNSAwLjcyMzU3OTMsMCAxLjMxMDE1NjIsLTAuNTg2NTc3IDEuMzEwMTU2MiwtMS4zMTAxNTYzIDAsLTAuNDI0NTcwOCAtMC4yMDU1MTc1LC0wLjc5Nzc5NjYgLTAuNTE4NjAzNSwtMS4wMzcyMDcgeiBtIDMuMDg0MzI2MiwwIGMgMC4xNDEyNjY3LDAuMjA5MTAyNCAwLjIxODM1OTQsMC40NjU2MjA2IDAuMjE4MzU5NCwwLjczNjk2MjkgMCwwLjcyMzU3OTMgLTAuNTg2NTc3LDEuMzEwMTU2MyAtMS4zMTAxNTYzLDEuMzEwMTU2MyAtMC4yNzEzNDIzLDAgLTAuNTI3ODYwNSwtMC4wNzcwOTMgLTAuNzM2OTYyOSwtMC4yMTgzNTk0IDAuMjM5NDEwNCwwLjMxMzA4NTkgMC42MTI2MzYyLDAuNTE4NjAzNSAxLjAzNzIwNywwLjUxODYwMzUgMC43MjM1NzkzLDAgMS4zMTAxNTYzLC0wLjU4NjU3NyAxLjMxMDE1NjMsLTEuMzEwMTU2MyAwLC0wLjQyNDU3MDggLTAuMjA1NTE3NiwtMC43OTc3OTY2IC0wLjUxODYwMzUsLTEuMDM3MjA3IHoiIC8+ICA8L2c+PC9zdmc+);background-repeat:no-repeat;background-position:100% 100%;pointer-events:auto!important}.os-host-rtl>.os-scrollbar-corner.os-scrollbar-corner-resize{-webkit-transform:scale(-1,1);transform:scale(-1,1)}.os-host-overflow{overflow:hidden!important}@-webkit-keyframes hs-resize-observer-dummy-animation{0%{z-index:0}to{z-index:-1}}@keyframes hs-resize-observer-dummy-animation{0%{z-index:0}to{z-index:-1}}.os-theme-none>.os-scrollbar-horizontal,.os-theme-none>.os-scrollbar-vertical,.os-theme-none>.os-scrollbar-corner{display:none!important}.os-theme-none>.os-scrollbar-corner-resize{display:block!important;min-width:10px;min-height:10px}.os-theme-dark>.os-scrollbar-horizontal,.os-theme-light>.os-scrollbar-horizontal{right:10px;height:10px}.os-theme-dark>.os-scrollbar-vertical,.os-theme-light>.os-scrollbar-vertical{bottom:10px;width:10px}.os-theme-dark.os-host-rtl>.os-scrollbar-horizontal,.os-theme-light.os-host-rtl>.os-scrollbar-horizontal{left:10px;right:0}.os-theme-dark>.os-scrollbar-corner,.os-theme-light>.os-scrollbar-corner{height:10px;width:10px}.os-theme-dark>.os-scrollbar-corner,.os-theme-light>.os-scrollbar-corner{background-color:transparent}.os-theme-dark>.os-scrollbar,.os-theme-light>.os-scrollbar{padding:2px;box-sizing:border-box;background:0 0}.os-theme-dark>.os-scrollbar.os-scrollbar-unusable,.os-theme-light>.os-scrollbar.os-scrollbar-unusable{background:0 0}.os-theme-dark>.os-scrollbar>.os-scrollbar-track,.os-theme-light>.os-scrollbar>.os-scrollbar-track{background:0 0}.os-theme-dark>.os-scrollbar-horizontal>.os-scrollbar-track>.os-scrollbar-handle,.os-theme-light>.os-scrollbar-horizontal>.os-scrollbar-track>.os-scrollbar-handle{min-width:30px}.os-theme-dark>.os-scrollbar-vertical>.os-scrollbar-track>.os-scrollbar-handle,.os-theme-light>.os-scrollbar-vertical>.os-scrollbar-track>.os-scrollbar-handle{min-height:30px}.os-theme-dark.os-host-transition>.os-scrollbar>.os-scrollbar-track>.os-scrollbar-handle,.os-theme-light.os-host-transition>.os-scrollbar>.os-scrollbar-track>.os-scrollbar-handle{-webkit-transition:background-color .3s;transition:background-color .3s}.os-theme-dark>.os-scrollbar>.os-scrollbar-track>.os-scrollbar-handle,.os-theme-light>.os-scrollbar>.os-scrollbar-track>.os-scrollbar-handle,.os-theme-dark>.os-scrollbar>.os-scrollbar-track,.os-theme-light>.os-scrollbar>.os-scrollbar-track{border-radius:10px}.os-theme-dark>.os-scrollbar>.os-scrollbar-track>.os-scrollbar-handle{background:rgba(0,0,0,.4)}.os-theme-light>.os-scrollbar>.os-scrollbar-track>.os-scrollbar-handle{background:rgba(255,255,255,.4)}.os-theme-dark>.os-scrollbar:hover>.os-scrollbar-track>.os-scrollbar-handle{background:rgba(0,0,0,.55)}.os-theme-light>.os-scrollbar:hover>.os-scrollbar-track>.os-scrollbar-handle{background:rgba(255,255,255,.55)}.os-theme-dark>.os-scrollbar>.os-scrollbar-track>.os-scrollbar-handle.active{background:rgba(0,0,0,.7)}.os-theme-light>.os-scrollbar>.os-scrollbar-track>.os-scrollbar-handle.active{background:rgba(255,255,255,.7)}.os-theme-dark>.os-scrollbar-horizontal .os-scrollbar-handle:before,.os-theme-dark>.os-scrollbar-vertical .os-scrollbar-handle:before,.os-theme-light>.os-scrollbar-horizontal .os-scrollbar-handle:before,.os-theme-light>.os-scrollbar-vertical .os-scrollbar-handle:before{content:'';position:absolute;left:0;right:0;top:0;bottom:0;display:block}.os-theme-dark.os-host-scrollbar-horizontal-hidden>.os-scrollbar-horizontal .os-scrollbar-handle:before,.os-theme-dark.os-host-scrollbar-vertical-hidden>.os-scrollbar-vertical .os-scrollbar-handle:before,.os-theme-light.os-host-scrollbar-horizontal-hidden>.os-scrollbar-horizontal .os-scrollbar-handle:before,.os-theme-light.os-host-scrollbar-vertical-hidden>.os-scrollbar-vertical .os-scrollbar-handle:before{display:none}.os-theme-dark>.os-scrollbar-horizontal .os-scrollbar-handle:before,.os-theme-light>.os-scrollbar-horizontal .os-scrollbar-handle:before{top:-6px;bottom:-2px}.os-theme-dark>.os-scrollbar-vertical .os-scrollbar-handle:before,.os-theme-light>.os-scrollbar-vertical .os-scrollbar-handle:before{left:-6px;right:-2px}.os-host-rtl.os-theme-dark>.os-scrollbar-vertical .os-scrollbar-handle:before,.os-host-rtl.os-theme-light>.os-scrollbar-vertical .os-scrollbar-handle:before{right:-6px;left:-2px} \ No newline at end of file diff --git a/js/OverlayScrollbars.js b/js/OverlayScrollbars.js index 3695d92b..69c46e98 100644 --- a/js/OverlayScrollbars.js +++ b/js/OverlayScrollbars.js @@ -2,13 +2,13 @@ * OverlayScrollbars * https://github.com/KingSora/OverlayScrollbars * - * Version: 1.10.2 + * Version: 1.10.3 * * Copyright KingSora | Rene Haas. * https://github.com/KingSora * * Released under the MIT license. - * Date: 30.12.2019 + * Date: 02.02.2020 */ (function (global, factory) { @@ -3998,7 +3998,7 @@ var cursorIsLastPosition = (cursorPos >= cursorMax && _textareaHasFocus); var textareaScrollAmount = { x: (!textareaAutoWrapping && (cursorCol === lastCol && cursorRow === widestRow)) ? _overflowAmountCache.x : -1, - y: (textareaAutoWrapping ? cursorIsLastPosition || textareaRowsChanged && (previousOverflowAmount ? (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; @@ -5822,11 +5822,14 @@ var possibleElement = coordinatesIsElementObj ? coordinates.el : coordinates; var possibleElementIsJQuery = possibleElement instanceof FRAMEWORK || JQUERY ? possibleElement instanceof JQUERY : false; var possibleElementIsHTMLElement = possibleElementIsJQuery ? false : isHTMLElement(possibleElement); - var proxyCompleteCallback = type(completeCallback) != TYPES.f ? undefined : function () { + var updateScrollbarInfos = function () { if (doScrollLeft) refreshScrollbarHandleOffset(true); if (doScrollTop) refreshScrollbarHandleOffset(false); + }; + var proxyCompleteCallback = type(completeCallback) != TYPES.f ? undefined : function () { + updateScrollbarInfos(); completeCallback(); }; function checkSettingsStringValue(currValue, allowedValues) { @@ -6118,6 +6121,7 @@ _viewportElement[_strScrollLeft](finalScroll[_strScrollLeft]); if (doScrollTop) _viewportElement[_strScrollTop](finalScroll[_strScrollTop]); + updateScrollbarInfos(); } }; diff --git a/js/OverlayScrollbars.min.js b/js/OverlayScrollbars.min.js index b6f984e0..a7d65254 100644 --- a/js/OverlayScrollbars.min.js +++ b/js/OverlayScrollbars.min.js @@ -2,12 +2,12 @@ * OverlayScrollbars * https://github.com/KingSora/OverlayScrollbars * - * Version: 1.10.2 + * Version: 1.10.3 * * Copyright KingSora | Rene Haas. * https://github.com/KingSora * * Released under the MIT license. - * Date: 30.12.2019 + * Date: 02.02.2020 */ -!function(n,t){"function"==typeof define&&define.amd?define(function(){return t(n,n.document,undefined)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(n,n.document,undefined):t(n,n.document,undefined)}("undefined"!=typeof window?window:this,function(bt,gt,yi){"use strict";var o,a,c,u,mt="object",wt="function",yt="array",xt="string",_t="boolean",Ot="number",f="undefined",n="null",St="class",xi="style",zt="id",_i="length",kt="prototype",Oi="offsetHeight",Si="clientHeight",zi="scrollHeight",ki="offsetWidth",Ci="clientWidth",Ii="scrollWidth",Ct="hasOwnProperty",Ti="getBoundingClientRect",It=(o={},a={},{e:c=["-webkit-","-moz-","-o-","-ms-"],u:u=["WebKit","Moz","O","MS"],v:function(n){var t=a[n];if(a[Ct](n))return t;for(var r,e,i,o=s(n),u=gt.createElement("div")[xi],f=0;f
'),o=S[0],e=Li(S.children("div").eq(0));O.append(S),S.hide().show();var t,r,u,f,a,c,s,l,v,h=z(o),d={x:0===h.x,y:0===h.y},p=(r=bt.navigator.userAgent,f="substring",a=r[u="indexOf"]("MSIE "),c=r[u]("Trident/"),s=r[u]("Edge/"),l=r[u]("rv:"),v=parseInt,0i&&(t.update("auto"),d[a]=new Date(o+=i)),n=Ei.max(1,Ei.min(n,i)));b=n}}else b=33};this.add=function(n){-1===e(n,h)&&(h.push(n),d.push(s()),0/g,(l?"-":Ie)+Ee)[v](/px/g,Ie)[v](/%/g," * "+c*(s&&Nt.n?-1:1)/100)[v](/vw/g," * "+de.w)[v](/vh/g," * "+de.h),hi(isNaN(t)?hi(h(t),!0).toFixed():t)):t)!==yi&&!isNaN(e)&&sn(e)==Ot){var d=y&&s,p=a*(d&&Nt.n?-1:1),b=d&&Nt.i,g=d&&Nt.n;switch(p=b?c-p:p,r){case"+=":i=p+e;break;case"-=":i=p-e;break;case"*=":i=p*e;break;case"/=":i=p/e;break;default:i=e}i=b?c-i:i,i*=g?-1:1,i=s&&Nt.n?Ei.min(0,Ei.max(c,i)):Ei.max(0,Ei.min(c,i))}return i===a?yi:i}function U(n,t,r,e){var i,o,u=[r,r],f=sn(n);if(f==t)n=[n,n];else if(f==yt){if(2<(i=n[H])||i<1)n=u;else for(1===i&&(n[1]=r),l=0;l=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom||Kn(),(ue||fe)&&ui(!1)}}function L(n){i=ar[I](),i=isNaN(i)?0:i,(Jt&&_&&!Nt.n||!Jt)&&(i=i<0?0:i),z=at()[C],S=a(n),j=!c(u),mi(W,Mn),mi(r.an,o),mi(r["in"],o),qn(M,[X,q,J],[h,H,Zn]),!R&&w||Ai.prvD(n),Ai.stpP(n)}Xn(r.an,V,function d(n){E(n)&&L(n)}),Xn(r.un,[V,Y,$],[function N(n){if(E(n)){var h,d=Ei.round(de[r.j]),p=r.un.offset()[r.B],t=n.ctrlKey,b=n.shiftKey,g=b&&t,m=!0,w=function(n){j&&ai(_,n)},y=function(){w(),L(n)},x=function(){if(!Bt){var n=(S-p)*z,t=k.R,r=k.W,e=k.D,i=k.N,o=k.H,u=270*T,f=m?Ei.max(400,u):u,a=i*((n-e/2)/(r-e)),c=Jt&&_&&(!Nt.i&&!Nt.n||qr),s=c?t"+(n||Ie)+""}function lt(n,t){var r=sn(t)==_t,e=r?ir:t||ir;return v&&!e[_i]?null:v?e[r?"children":"find"](B+n.replace(/\s/g,B)).eq(0):Li(pi(n))}function vt(n,t){for(var r,e=t.split(B),i=0;i
'),o=S[0],e=Li(S.children("div").eq(0));O.append(S),S.hide().show();var t,r,u,f,a,c,s,l,v,h=z(o),d={x:0===h.x,y:0===h.y},p=(r=bt.navigator.userAgent,f="substring",a=r[u="indexOf"]("MSIE "),c=r[u]("Trident/"),s=r[u]("Edge/"),l=r[u]("rv:"),v=parseInt,0i&&(t.update("auto"),d[a]=new Date(o+=i)),n=Ei.max(1,Ei.min(n,i)));b=n}}else b=33};this.add=function(n){-1===e(n,h)&&(h.push(n),d.push(s()),0/g,(l?"-":Ie)+Ee)[v](/px/g,Ie)[v](/%/g," * "+c*(s&&Nt.n?-1:1)/100)[v](/vw/g," * "+de.w)[v](/vh/g," * "+de.h),hi(isNaN(t)?hi(h(t),!0).toFixed():t)):t)!==yi&&!isNaN(e)&&ln(e)==Ot){var d=x&&s,p=a*(d&&Nt.n?-1:1),b=d&&Nt.i,g=d&&Nt.n;switch(p=b?c-p:p,r){case"+=":i=p+e;break;case"-=":i=p-e;break;case"*=":i=p*e;break;case"/=":i=p/e;break;default:i=e}i=b?c-i:i,i*=g?-1:1,i=s&&Nt.n?Ei.min(0,Ei.max(c,i)):Ei.max(0,Ei.min(c,i))}return i===a?yi:i}function V(n,t,r,e){var i,o,u=[r,r],f=ln(n);if(f==t)n=[n,n];else if(f==yt){if(2<(i=n[L])||i<1)n=u;else for(1===i&&(n[1]=r),v=0;v=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom||Kn(),(ue||fe)&&ui(!1)}}function L(n){i=ar[I](),i=isNaN(i)?0:i,(Jt&&_&&!Nt.n||!Jt)&&(i=i<0?0:i),z=at()[C],S=a(n),j=!c(u),mi(W,Mn),mi(r.an,o),mi(r["in"],o),qn(M,[X,q,J],[h,H,Zn]),!R&&w||Ai.prvD(n),Ai.stpP(n)}Xn(r.an,V,function d(n){E(n)&&L(n)}),Xn(r.un,[V,Y,$],[function N(n){if(E(n)){var h,d=Ei.round(de[r.j]),p=r.un.offset()[r.B],t=n.ctrlKey,b=n.shiftKey,g=b&&t,m=!0,w=function(n){j&&ai(_,n)},y=function(){w(),L(n)},x=function(){if(!Bt){var n=(S-p)*z,t=k.R,r=k.W,e=k.D,i=k.N,o=k.H,u=270*T,f=m?Ei.max(400,u):u,a=i*((n-e/2)/(r-e)),c=Jt&&_&&(!Nt.i&&!Nt.n||qr),s=c?t"+(n||Ie)+""}function lt(n,t){var r=ln(t)==_t,e=r?ir:t||ir;return v&&!e[_i]?null:v?e[r?"children":"find"](B+n.replace(/\s/g,B)).eq(0):Li(pi(n))}function vt(n,t){for(var r,e=t.split(B),i=0;i -1) { - if(argLen > 1) { + if (argLen > 1) { //unregister instance delete target[_instancePropertyString]; _targets.splice(index, 1); @@ -363,12 +363,12 @@ } } })(); - var PLUGIN = (function() { + var PLUGIN = (function () { var _plugin; var _pluginsGlobals; var _pluginsAutoUpdateLoop; - var _pluginsExtensions = [ ]; - var _pluginsOptions = (function() { + var _pluginsExtensions = []; + var _pluginsOptions = (function () { var type = COMPATIBILITY.type; var possibleTemplateTypes = [ TYPES.b, //boolean @@ -386,7 +386,7 @@ var booleanNullAllowedValues = [TYPES.z, TYPES.b]; var booleanTrueTemplate = [true, TYPES.b]; var booleanFalseTemplate = [false, TYPES.b]; - var callbackTemplate = [null, [TYPES.z, TYPES.f]]; + var callbackTemplate = [null, [TYPES.z, TYPES.f]]; var inheritedAttrsTemplate = [['style', 'class'], [TYPES.s, TYPES.a, TYPES.z]]; var resizeAllowedValues = 'n:none b:both h:horizontal v:vertical'; var overflowBehaviorAllowedValues = 'v-h:visible-hidden v-s:visible-scroll s:scroll h:hidden'; @@ -421,7 +421,7 @@ textarea: { dynWidth: booleanFalseTemplate, //true || false dynHeight: booleanFalseTemplate, //true || false - inheritedAttrs : inheritedAttrsTemplate //string || array || null + inheritedAttrs: inheritedAttrsTemplate //string || array || null }, callbacks: { onInitialized: callbackTemplate, //null || function @@ -438,30 +438,30 @@ onUpdated: callbackTemplate //null || function } }; - var convert = function(template) { - var recursive = function(obj) { + var convert = function (template) { + var recursive = function (obj) { var key; var val; var valType; - for(key in obj) { - if(!obj[LEXICON.hOP](key)) + for (key in obj) { + if (!obj[LEXICON.hOP](key)) continue; val = obj[key]; valType = type(val); - if(valType == TYPES.a) + if (valType == TYPES.a) obj[key] = val[template ? 1 : 0]; - else if(valType == TYPES.o) + else if (valType == TYPES.o) obj[key] = recursive(val); } return obj; }; - return recursive(FRAMEWORK.extend(true, { }, optionsDefaultsAndTemplate)); + return recursive(FRAMEWORK.extend(true, {}, optionsDefaultsAndTemplate)); }; return { - _defaults : convert(), + _defaults: convert(), - _template : convert(true), + _template: convert(true), /** * Validates the passed object by the passed template. @@ -471,13 +471,13 @@ * @param diffObj If a object is passed then only valid differences to this object will be returned. * @returns {{}} A object which contains two objects called "default" and "prepared" which contains only the valid properties of the passed original object and discards not different values compared to the passed diffObj. */ - _validate : function (obj, template, writeErrors, diffObj) { - var validatedOptions = { }; - var validatedOptionsPrepared = { }; - var objectCopy = FRAMEWORK.extend(true, { }, obj); + _validate: function (obj, template, writeErrors, diffObj) { + var validatedOptions = {}; + var validatedOptionsPrepared = {}; + var objectCopy = FRAMEWORK.extend(true, {}, obj); var inArray = FRAMEWORK.inArray; var isEmptyObj = FRAMEWORK.isEmptyObject; - var checkObjectProps = function(data, template, diffData, validatedOptions, validatedOptionsPrepared, prevPropName) { + var checkObjectProps = function (data, template, diffData, validatedOptions, validatedOptionsPrepared, prevPropName) { for (var prop in template) { if (template[LEXICON.hOP](prop) && data[LEXICON.hOP](prop)) { var isValid = false; @@ -485,14 +485,14 @@ var templateValue = template[prop]; var templateValueType = type(templateValue); var templateIsComplex = templateValueType == TYPES.o; - var templateTypes = type(templateValue) != TYPES.a ? [ templateValue ] : templateValue; + var templateTypes = type(templateValue) != TYPES.a ? [templateValue] : templateValue; var dataDiffValue = diffData[prop]; var dataValue = data[prop]; var dataValueType = type(dataValue); var propPrefix = prevPropName ? prevPropName + '.' : ''; var error = "The option \"" + propPrefix + prop + "\" wasn't set, because"; - var errorPossibleTypes = [ ]; - var errorRestrictedStrings = [ ]; + var errorPossibleTypes = []; + var errorRestrictedStrings = []; var restrictedStringValuesSplit; var restrictedStringValuesPossibilitiesSplit; var isRestrictedValue; @@ -502,66 +502,66 @@ var v; var j; - dataDiffValue = dataDiffValue === undefined ? { } : dataDiffValue; - + dataDiffValue = dataDiffValue === undefined ? {} : dataDiffValue; + //if the template has a object as value, it means that the options are complex (verschachtelt) - if(templateIsComplex && dataValueType == TYPES.o) { - validatedOptions[prop] = { }; - validatedOptionsPrepared[prop] = { }; + if (templateIsComplex && dataValueType == TYPES.o) { + validatedOptions[prop] = {}; + validatedOptionsPrepared[prop] = {}; checkObjectProps(dataValue, templateValue, dataDiffValue, validatedOptions[prop], validatedOptionsPrepared[prop], propPrefix + prop); - FRAMEWORK.each([ data, validatedOptions, validatedOptionsPrepared ], function(index, value) { - if(isEmptyObj(value[prop])) { + FRAMEWORK.each([data, validatedOptions, validatedOptionsPrepared], function (index, value) { + if (isEmptyObj(value[prop])) { delete value[prop]; } }); } - else if(!templateIsComplex) { - for(i = 0; i < templateTypes[LEXICON.l]; i++) { + else if (!templateIsComplex) { + for (i = 0; i < templateTypes[LEXICON.l]; i++) { currType = templateTypes[i]; templateValueType = type(currType); //if currtype is string and starts with restrictedStringPrefix and end with restrictedStringSuffix isRestrictedValue = templateValueType == TYPES.s && inArray(currType, possibleTemplateTypes) === -1; - if(isRestrictedValue) { + if (isRestrictedValue) { errorPossibleTypes.push(TYPES.s); //split it into a array which contains all possible values for example: ["y:yes", "n:no", "m:maybe"] restrictedStringValuesSplit = currType.split(restrictedStringsSplit); errorRestrictedStrings = errorRestrictedStrings.concat(restrictedStringValuesSplit); - for(v = 0; v < restrictedStringValuesSplit[LEXICON.l]; v++) { + for (v = 0; v < restrictedStringValuesSplit[LEXICON.l]; v++) { //split the possible values into their possibiliteis for example: ["y", "yes"] -> the first is always the mainPossibility restrictedStringValuesPossibilitiesSplit = restrictedStringValuesSplit[v].split(restrictedStringsPossibilitiesSplit); mainPossibility = restrictedStringValuesPossibilitiesSplit[0]; - for(j = 0; j < restrictedStringValuesPossibilitiesSplit[LEXICON.l]; j++) { + for (j = 0; j < restrictedStringValuesPossibilitiesSplit[LEXICON.l]; j++) { //if any possibility matches with the dataValue, its valid - if(dataValue === restrictedStringValuesPossibilitiesSplit[j]) { + if (dataValue === restrictedStringValuesPossibilitiesSplit[j]) { isValid = true; break; } } - if(isValid) + if (isValid) break; } } else { errorPossibleTypes.push(currType); - if(dataValueType === currType) { + if (dataValueType === currType) { isValid = true; break; } } } - if(isValid) { + if (isValid) { isDiff = dataValue !== dataDiffValue; - - if(isDiff) + + if (isDiff) validatedOptions[prop] = dataValue; - - if(isRestrictedValue ? inArray(dataDiffValue, restrictedStringValuesPossibilitiesSplit) < 0 : isDiff) + + if (isRestrictedValue ? inArray(dataDiffValue, restrictedStringValuesPossibilitiesSplit) < 0 : isDiff) validatedOptionsPrepared[prop] = isRestrictedValue ? mainPossibility : dataValue; } - else if(writeErrors) { + else if (writeErrors) { console.warn(error + " it doesn't accept the type [ " + dataValueType.toUpperCase() + " ] with the value of \"" + dataValue + "\".\r\n" + "Accepted types are: [ " + errorPossibleTypes.join(', ').toUpperCase() + " ]." + (errorRestrictedStrings[length] > 0 ? "\r\nValid strings are: [ " + errorRestrictedStrings.join(', ').split(restrictedStringsPossibilitiesSplit).join(', ') + " ]." : '')); @@ -571,7 +571,7 @@ } } }; - checkObjectProps(objectCopy, template, diffObj || { }, validatedOptions, validatedOptionsPrepared); + checkObjectProps(objectCopy, template, diffObj || {}, validatedOptions, validatedOptionsPrepared); //add values which aren't specified in the template to the finished validated object to prevent them from being discarded /* @@ -580,13 +580,13 @@ FRAMEWORK.extend(true, validatedOptionsPrepared, objectCopy); } */ - - if(!isEmptyObj(objectCopy) && writeErrors) + + if (!isEmptyObj(objectCopy) && writeErrors) console.warn('The following options are discarded due to invalidity:\r\n' + window.JSON.stringify(objectCopy, null, 2)); return { - _default : validatedOptions, - _prepared : validatedOptionsPrepared + _default: validatedOptions, + _prepared: validatedOptionsPrepared }; } } @@ -596,9 +596,9 @@ * Initializes the object which contains global information about the plugin and each instance of it. */ function initOverlayScrollbarsStatics() { - if(!_pluginsGlobals) + if (!_pluginsGlobals) _pluginsGlobals = new OverlayScrollbarsGlobals(_pluginsOptions._defaults); - if(!_pluginsAutoUpdateLoop) + if (!_pluginsAutoUpdateLoop) _pluginsAutoUpdateLoop = new OverlayScrollbarsAutoUpdateLoop(_pluginsGlobals); } @@ -625,7 +625,7 @@ x: nativeScrollbarSize.x === 0, y: nativeScrollbarSize.y === 0 }; - var msie = (function() { + var msie = (function () { var ua = window.navigator.userAgent; var strIndexOf = 'indexOf'; var strSubString = 'substring'; @@ -653,34 +653,34 @@ })(); FRAMEWORK.extend(_base, { - defaultOptions : defaultOptions, - msie : msie, - autoUpdateLoop : false, - autoUpdateRecommended : !COMPATIBILITY.mO(), - nativeScrollbarSize : nativeScrollbarSize, - nativeScrollbarIsOverlaid : nativeScrollbarIsOverlaid, - nativeScrollbarStyling : (function() { + defaultOptions: defaultOptions, + msie: msie, + autoUpdateLoop: false, + autoUpdateRecommended: !COMPATIBILITY.mO(), + nativeScrollbarSize: nativeScrollbarSize, + nativeScrollbarIsOverlaid: nativeScrollbarIsOverlaid, + nativeScrollbarStyling: (function () { var result = false; scrollbarDummyElement.addClass('os-viewport-native-scrollbars-invisible'); try { result = (scrollbarDummyElement.css('scrollbar-width') === 'none' && (msie > 9 || !msie)) || window.getComputedStyle(scrollbarDummyElement0, '::-webkit-scrollbar').getPropertyValue('display') === 'none'; } catch (ex) { } - + //fix opera bug: scrollbar styles will only appear if overflow value is scroll or auto during the activation of the style. //and set overflow to scroll //scrollbarDummyElement.css(strOverflow, strHidden).hide().css(strOverflow, strScroll).show(); //return (scrollbarDummyElement0[LEXICON.oH] - scrollbarDummyElement0[LEXICON.cH]) === 0 && (scrollbarDummyElement0[LEXICON.oW] - scrollbarDummyElement0[LEXICON.cW]) === 0; - + return result; })(), - overlayScrollbarDummySize : { x: 30, y: 30 }, - cssCalc : (function() { + overlayScrollbarDummySize: { x: 30, y: 30 }, + cssCalc: (function () { var dummyStyle = document.createElement('div')[LEXICON.s]; var strCalc = 'calc'; var i = -1; var prop; - for(; i < VENDORS._cssPrefixes[LEXICON.l]; i++) { + for (; i < VENDORS._cssPrefixes[LEXICON.l]; i++) { prop = i < 0 ? strCalc : VENDORS._cssPrefixes[i] + strCalc; dummyStyle.cssText = 'width:' + prop + '(1px);'; if (dummyStyle[LEXICON.l]) @@ -688,22 +688,22 @@ } return null; })(), - restrictedMeasuring : (function() { + restrictedMeasuring: (function () { //https://bugzilla.mozilla.org/show_bug.cgi?id=1439305 scrollbarDummyElement.css(strOverflow, strHidden); var scrollSize = { - w : scrollbarDummyElement0[LEXICON.sW], - h : scrollbarDummyElement0[LEXICON.sH] + w: scrollbarDummyElement0[LEXICON.sW], + h: scrollbarDummyElement0[LEXICON.sH] }; scrollbarDummyElement.css(strOverflow, 'visible'); var scrollSize2 = { - w : scrollbarDummyElement0[LEXICON.sW], - h : scrollbarDummyElement0[LEXICON.sH] + w: scrollbarDummyElement0[LEXICON.sW], + h: scrollbarDummyElement0[LEXICON.sH] }; return (scrollSize.w - scrollSize2.w) !== 0 || (scrollSize.h - scrollSize2.h) !== 0; })(), - rtlScrollBehavior : (function() { - scrollbarDummyElement.css({ 'overflow-y' : strHidden, 'overflow-x' : strScroll, 'direction' : 'rtl' }).scrollLeft(0); + rtlScrollBehavior: (function () { + scrollbarDummyElement.css({ 'overflow-y': strHidden, 'overflow-x': strScroll, 'direction': 'rtl' }).scrollLeft(0); var dummyContainerOffset = scrollbarDummyElement.offset(); var dummyContainerChildOffset = dummyContainerChild.offset(); scrollbarDummyElement.scrollLeft(999); @@ -713,44 +713,44 @@ //'i' means 'invert' (i === true means that the axis must be inverted to be correct) //true = on the left side //false = on the right side - i : dummyContainerOffset.left === dummyContainerChildOffset.left, + i: dummyContainerOffset.left === dummyContainerChildOffset.left, //negative = determines if the maximum scroll is positive or negative //'n' means 'negate' (n === true means that the axis must be negated to be correct) //true = negative //false = positive - n : dummyContainerChildOffset.left - dummyContainerScrollOffsetAfterScroll.left === 0 + n: dummyContainerChildOffset.left - dummyContainerScrollOffsetAfterScroll.left === 0 }; })(), - supportTransform : VENDORS._cssProperty('transform') !== undefined, - supportTransition : VENDORS._cssProperty('transition') !== undefined, - supportPassiveEvents : (function() { + supportTransform: VENDORS._cssProperty('transform') !== undefined, + supportTransition: VENDORS._cssProperty('transition') !== undefined, + supportPassiveEvents: (function () { var supportsPassive = false; try { - window.addEventListener('test', null, Object.defineProperty({ }, 'passive', { - get: function() { + window.addEventListener('test', null, Object.defineProperty({}, 'passive', { + get: function () { supportsPassive = true; } })); } catch (e) { } return supportsPassive; })(), - supportResizeObserver : !!COMPATIBILITY.rO(), - supportMutationObserver : !!COMPATIBILITY.mO() + supportResizeObserver: !!COMPATIBILITY.rO(), + supportMutationObserver: !!COMPATIBILITY.mO() }); scrollbarDummyElement.removeAttr(LEXICON.s).remove(); //Catch zoom event: (function () { - if(nativeScrollbarIsOverlaid.x && nativeScrollbarIsOverlaid.y) + if (nativeScrollbarIsOverlaid.x && nativeScrollbarIsOverlaid.y) return; var abs = MATH.abs; var windowWidth = COMPATIBILITY.wW(); var windowHeight = COMPATIBILITY.wH(); var windowDpr = getWindowDPR(); - var onResize = function() { - if(INSTANCES().length > 0) { + var onResize = function () { + if (INSTANCES().length > 0) { var newW = COMPATIBILITY.wW(); var newH = COMPATIBILITY.wH(); var deltaW = newW - windowWidth; @@ -778,9 +778,9 @@ bodyElement.append(scrollbarDummyElement); newScrollbarSize = _base.nativeScrollbarSize = calcNativeScrollbarSize(scrollbarDummyElement[0]); scrollbarDummyElement.remove(); - if(oldScrollbarSize.x !== newScrollbarSize.x || oldScrollbarSize.y !== newScrollbarSize.y) { + if (oldScrollbarSize.x !== newScrollbarSize.x || oldScrollbarSize.y !== newScrollbarSize.y) { FRAMEWORK.each(INSTANCES(), function () { - if(INSTANCES(this)) + if (INSTANCES(this)) INSTANCES(this).update('zoom'); }); } @@ -826,20 +826,20 @@ var _strAutoUpdate = 'autoUpdate'; var _strAutoUpdateInterval = _strAutoUpdate + 'Interval'; var _strLength = LEXICON.l; - var _loopingInstances = [ ]; - var _loopingInstancesIntervalCache = [ ]; + var _loopingInstances = []; + var _loopingInstancesIntervalCache = []; var _loopIsActive = false; var _loopIntervalDefault = 33; var _loopInterval = _loopIntervalDefault; var _loopTimeOld = _getNow(); var _loopID; - + /** * The auto update loop which will run every 50 milliseconds or less if the update interval of a instance is lower than 50 milliseconds. */ - var loop = function() { - if(_loopingInstances[_strLength] > 0 && _loopIsActive) { + var loop = function () { + if (_loopingInstances[_strLength] > 0 && _loopIsActive) { _loopID = COMPATIBILITY.rAF()(function () { loop(); }); @@ -855,7 +855,7 @@ if (timeDelta > _loopInterval) { _loopTimeOld = timeNew - (timeDelta % _loopInterval); lowestInterval = _loopIntervalDefault; - for(var i = 0; i < _loopingInstances[_strLength]; i++) { + for (var i = 0; i < _loopingInstances[_strLength]; i++) { instance = _loopingInstances[i]; if (instance !== undefined) { instanceOptions = instance.options(); @@ -882,8 +882,8 @@ * Add OverlayScrollbars instance to the auto update loop. Only successful if the instance isn't already added. * @param instance The instance which shall be updated in a loop automatically. */ - _base.add = function(instance) { - if(_inArray(instance, _loopingInstances) === -1) { + _base.add = function (instance) { + if (_inArray(instance, _loopingInstances) === -1) { _loopingInstances.push(instance); _loopingInstancesIntervalCache.push(_getNow()); if (_loopingInstances[_strLength] > 0 && !_loopIsActive) { @@ -898,9 +898,9 @@ * Remove OverlayScrollbars instance from the auto update loop. Only successful if the instance was added before. * @param instance The instance which shall be updated in a loop automatically. */ - _base.remove = function(instance) { + _base.remove = function (instance) { var index = _inArray(instance, _loopingInstances); - if(index > -1) { + if (index > -1) { //remove from loopingInstances list _loopingInstancesIntervalCache.splice(index, 1); _loopingInstances.splice(index, 1); @@ -909,7 +909,7 @@ if (_loopingInstances[_strLength] === 0 && _loopIsActive) { _loopIsActive = false; globals.autoUpdateLoop = _loopIsActive; - if(_loopID !== undefined) { + if (_loopID !== undefined) { COMPATIBILITY.cAF()(_loopID); _loopID = -1; } @@ -933,17 +933,17 @@ var type = COMPATIBILITY.type; var inArray = FRAMEWORK.inArray; var each = FRAMEWORK.each; - + //make correct instanceof var _base = new _plugin(); var _frameworkProto = FRAMEWORK[LEXICON.p]; - + //if passed element is no HTML element: skip and return - if(!isHTMLElement(pluginTargetElement)) + if (!isHTMLElement(pluginTargetElement)) return; - + //if passed element is already initialized: set passed options if there are any and return its instance - if(INSTANCES(pluginTargetElement)) { + if (INSTANCES(pluginTargetElement)) { var inst = INSTANCES(pluginTargetElement); inst.options(options); return inst; @@ -984,11 +984,11 @@ var _marginY; var _isRTL; var _sleeping; - var _contentBorderSize = { }; - var _scrollHorizontalInfo = { }; - var _scrollVerticalInfo = { }; - var _viewportSize = { }; - var _nativeScrollbarMinSize = { }; + var _contentBorderSize = {}; + var _scrollHorizontalInfo = {}; + var _scrollVerticalInfo = {}; + var _viewportSize = {}; + var _nativeScrollbarMinSize = {}; //naming: var _strMinusHidden = '-hidden'; @@ -1085,9 +1085,9 @@ _classNameScrollbarCornerResizeH, _classNameScrollbarCornerResizeV, _classNameDragging].join(_strSpace); - + //callbacks: - var _callbacksInitQeueue = [ ]; + var _callbacksInitQeueue = []; //options: var _defaultOptions; @@ -1095,15 +1095,15 @@ var _currentPreparedOptions; //extensions: - var _extensions = { }; + var _extensions = {}; var _extensionsPrivateMethods = 'added removed on contract'; //update var _lastUpdateTime; - var _swallowedUpdateHints = { }; + var _swallowedUpdateHints = {}; var _swallowedUpdateTimeout; var _swallowUpdateLag = 42; - var _imgs = [ ]; + var _imgs = []; //DOM elements: var _windowElement; @@ -1178,7 +1178,7 @@ var _bodyMinSizeCache; var _viewportScrollSizeCache; var _displayIsHiddenCache; - var _updateAutoCache = { }; + var _updateAutoCache = {}; //MutationObserver: var _mutationObserverHost; @@ -1190,7 +1190,7 @@ var _mutationObserverAttrsHost = [LEXICON.i, LEXICON.c, LEXICON.s, 'open']; //events: - var _destroyEvents = [ ]; + var _destroyEvents = []; //textarea: var _textareaHasFocus; @@ -1205,14 +1205,14 @@ var _scrollbarsAutoHideLeave; var _scrollbarsHandleHovered; var _scrollbarsHandlesDefineScrollPos; - + //resize var _resizeNone; var _resizeBoth; var _resizeHorizontal; var _resizeVertical; - - + + //==== Event Listener ====// /** @@ -1229,13 +1229,13 @@ var events = collected ? false : eventNames.split(_strSpace) var i = 0; - if(collected) { + if (collected) { for (; i < eventNames[LEXICON.l]; i++) setupResponsiveEventListener(element, eventNames[i], listener[i], remove); } else { for (; i < events[LEXICON.l]; i++) { - if(_supportPassiveEvents) + if (_supportPassiveEvents) element[0][method](events[i], listener, { passive: passive || false }); else element[onOff](events[i], listener); @@ -1257,7 +1257,7 @@ * @param onElementResizedCallback The callback which is fired every time the resize observer registers a size change or false / undefined if the resizeObserver shall be removed. */ function setupResizeObserver(targetElement, onElementResizedCallback) { - if(targetElement) { + if (targetElement) { var resizeObserver = COMPATIBILITY.rO(); var strAnimationStartEvent = 'animationstart mozAnimationStart webkitAnimationStart MSAnimationStart'; var strChildNodes = 'childNodes'; @@ -1267,7 +1267,7 @@ onElementResizedCallback(); }; //add resize observer: - if(onElementResizedCallback) { + if (onElementResizedCallback) { if (_supportResizeObserver) { var element = targetElement.append(generateDiv(_classNameResizeObserverElement + ' observed')).contents()[0]; var observer = element[_strResizeObserverProperty] = new resizeObserver(callback); @@ -1277,12 +1277,12 @@ if (_msieVersion > 9 || !_autoUpdateRecommended) { targetElement.prepend( generateDiv(_classNameResizeObserverElement, - generateDiv({ c : _classNameResizeObserverItemElement, dir : 'ltr' }, + generateDiv({ c: _classNameResizeObserverItemElement, dir: 'ltr' }, generateDiv(_classNameResizeObserverItemElement, generateDiv(_classNameResizeObserverItemFinalElement) ) + generateDiv(_classNameResizeObserverItemElement, - generateDiv({ c : _classNameResizeObserverItemFinalElement, style : 'width: 200%; height: 200%' }) + generateDiv({ c: _classNameResizeObserverItemFinalElement, style: 'width: 200%; height: 200%' }) ) ) ) @@ -1334,7 +1334,7 @@ COMPATIBILITY.cAF()(rAFId); rAFId = COMPATIBILITY.rAF()(onResized); } - else if(!event) + else if (!event) onResized(); reset(); @@ -1395,7 +1395,7 @@ } if (targetElement[0] === _sizeObserverElementNative) { - var directionChanged = function() { + var directionChanged = function () { var dir = _hostElement.css('direction'); var css = {}; var scrollLeftValue = 0; @@ -1420,12 +1420,12 @@ return result; }; directionChanged(); - addDestroyEventListener(targetElement, _strScroll, function(event) { + addDestroyEventListener(targetElement, _strScroll, function (event) { if (directionChanged()) update(); COMPATIBILITY.prvD(event); COMPATIBILITY.stpP(event); - return false; + return false; }); } } @@ -1434,7 +1434,7 @@ if (_supportResizeObserver) { var element = targetElement.contents()[0]; var resizeObserverObj = element[_strResizeObserverProperty]; - if(resizeObserverObj) { + if (resizeObserverObj) { resizeObserverObj.disconnect(); delete element[_strResizeObserverProperty]; } @@ -1502,10 +1502,10 @@ var sizeAuto; var action; - _mutationObserverHostCallback = function(mutations) { + _mutationObserverHostCallback = function (mutations) { var doUpdate = false; var mutation; - + if (_initialized && !_sleeping) { each(mutations, function () { mutation = this; @@ -1531,7 +1531,7 @@ _mutationObserverContentCallback = function (mutations) { var doUpdate = false; var mutation; - + if (_initialized && !_sleeping) { each(mutations, function () { mutation = this; @@ -1543,7 +1543,7 @@ now = COMPATIBILITY.now(); sizeAuto = (_heightAutoCache || _widthAutoCache); action = function () { - if(!_destroyed) { + if (!_destroyed) { contentLastUpdate = now; //if cols, rows or wrap attr was changed @@ -1607,8 +1607,8 @@ } } - - //==== Events of elements ====// + + //==== Events of elements ====// /** * This method gets called every time the host element gets resized. IMPORTANT: Padding changes are detected too!! @@ -1622,11 +1622,11 @@ w: _sizeObserverElementNative[LEXICON.sW], h: _sizeObserverElementNative[LEXICON.sH] }; - + changed = checkCache(hostSize, _hostElementSizeChangeDetectedCache); _hostElementSizeChangeDetectedCache = hostSize; if (changed) - update({ _hostSizeChanged : true }); + update({ _hostSizeChanged: true }); } } @@ -1673,25 +1673,25 @@ * A callback which will be called after a img element has downloaded its src asynchronous. */ function imgOnLoad() { - update({ _contentSizeChanged : true }); + update({ _contentSizeChanged: true }); } - /** - * Adds or removes mouse & touch events of the host element. (for handling auto-hiding of the scrollbars) - * @param destroy Indicates whether the events shall be added or removed. - */ + /** + * Adds or removes mouse & touch events of the host element. (for handling auto-hiding of the scrollbars) + * @param destroy Indicates whether the events shall be added or removed. + */ function setupHostMouseTouchEvents(destroy) { - setupResponsiveEventListener(_hostElement, - _strMouseTouchMoveEvent, - hostOnMouseMove, + setupResponsiveEventListener(_hostElement, + _strMouseTouchMoveEvent, + hostOnMouseMove, (_scrollbarsAutoHideMove ? destroy : true), true); - setupResponsiveEventListener(_hostElement, - [ _strMouseTouchEnter, _strMouseTouchLeave ], - [ hostOnMouseEnter, hostOnMouseLeave ], + setupResponsiveEventListener(_hostElement, + [_strMouseTouchEnter, _strMouseTouchLeave], + [hostOnMouseEnter, hostOnMouseLeave], (_scrollbarsAutoHideMove ? true : destroy), true); //if the plugin is initialized and the mouse is over the host element, make the scrollbars visible - if(!_initialized && !destroy) + if (!_initialized && !destroy) _hostElement.one('mouseover', hostOnMouseEnter); } @@ -1804,12 +1804,12 @@ function updateAutoContentSizeChanged() { if (_sleeping) return false; - + var contentMeasureElement = getContentMeasureElement(); var textareaValueLength = _isTextarea && _widthAutoCache && !_textareaAutoWrappingCache ? _targetElement.val().length : 0; var setCSS = !_mutationObserversConnected && _widthAutoCache && !_isTextarea; - var viewportScrollSize = { }; - var css = { }; + var viewportScrollSize = {}; + var css = {}; var float; var bodyMinSizeC; var changed; @@ -1818,10 +1818,10 @@ //fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1439305, it only works with "clipAlways : true" //it can work with "clipAlways : false" too, but I had to set the overflow of the viewportElement to hidden every time before measuring - if(_restrictedMeasuring) { + if (_restrictedMeasuring) { viewportScrollSize = { - x : _viewportElementNative[LEXICON.sW], - y : _viewportElementNative[LEXICON.sH] + x: _viewportElementNative[LEXICON.sW], + y: _viewportElementNative[LEXICON.sH] } } if (setCSS) { @@ -1857,36 +1857,36 @@ function meaningfulAttrsChanged() { if (_sleeping || _mutationObserversConnected) return; - + var changed; var elem; var curr; var cache; var checks = [ { - _elem: _hostElement, - _props : _mutationObserverAttrsHost.concat(':visible') + _elem: _hostElement, + _props: _mutationObserverAttrsHost.concat(':visible') }, { - _elem: _isTextarea ? _targetElement : undefined, - _props : _mutationObserverAttrsTextarea + _elem: _isTextarea ? _targetElement : undefined, + _props: _mutationObserverAttrsTextarea } ]; - - each(checks, function(index, check) { + + each(checks, function (index, check) { elem = check._elem; - if(elem) { - each(check._props, function(index, prop) { + if (elem) { + each(check._props, function (index, prop) { curr = prop.charAt(0) === ':' ? elem.is(prop) : elem.attr(prop); cache = _updateAutoCache[prop]; - + changed = changed || checkCache(curr, cache); - + _updateAutoCache[prop] = curr; }); } }); - + return changed; } @@ -1966,7 +1966,7 @@ return sizeIsAffected; } - + //==== Update ====// /** @@ -1977,7 +1977,7 @@ var wrapAttrOff = !_textareaAutoWrappingCache; var minWidth = _viewportSize.w; var minHeight = _viewportSize.h; - var css = { }; + var css = {}; var doMeasure = _widthAutoCache || wrapAttrOff; var origWidth; var width; @@ -2041,20 +2041,20 @@ */ function update(updateHints) { clearTimeout(_swallowedUpdateTimeout); - updateHints = updateHints || { }; + updateHints = updateHints || {}; _swallowedUpdateHints._hostSizeChanged |= updateHints._hostSizeChanged; _swallowedUpdateHints._contentSizeChanged |= updateHints._contentSizeChanged; _swallowedUpdateHints._force |= updateHints._force; - + var now = COMPATIBILITY.now(); var hostSizeChanged = !!_swallowedUpdateHints._hostSizeChanged; var contentSizeChanged = !!_swallowedUpdateHints._contentSizeChanged; var force = !!_swallowedUpdateHints._force; - var changedOptions = updateHints._changedOptions; - var swallow = _swallowUpdateLag > 0 && _initialized && !_destroyed && !force && !changedOptions && (now - _lastUpdateTime) < _swallowUpdateLag && (!_heightAutoCache && !_widthAutoCache); + var changedOptions = updateHints._changedOptions; + var swallow = _swallowUpdateLag > 0 && _initialized && !_destroyed && !force && !changedOptions && (now - _lastUpdateTime) < _swallowUpdateLag && (!_heightAutoCache && !_widthAutoCache); var displayIsHidden; - if(swallow) + if (swallow) _swallowedUpdateTimeout = setTimeout(update, _swallowUpdateLag); //abort update due to: @@ -2066,8 +2066,8 @@ return; _lastUpdateTime = now; - _swallowedUpdateHints = { }; - + _swallowedUpdateHints = {}; + //if scrollbar styling is possible and native scrollbars aren't overlaid the scrollbar styling will be applied which hides the native scrollbars completely. if (_nativeScrollbarStyling && !(_nativeScrollbarIsOverlaid.x && _nativeScrollbarIsOverlaid.y)) { //native scrollbars are hidden, so change the values to zero @@ -2087,15 +2087,15 @@ x: (_nativeScrollbarSize.x + (_nativeScrollbarIsOverlaid.x ? 0 : 3)) * 3, y: (_nativeScrollbarSize.y + (_nativeScrollbarIsOverlaid.y ? 0 : 3)) * 3 }; - + //changedOptions = changedOptions || { }; //freezeResizeObserver(_sizeObserverElement, true); //freezeResizeObserver(_sizeAutoObserverElement, true); - + var checkCacheAutoForce = function () { - return checkCache.apply(this, [].slice.call(arguments).concat([ force ])); + return checkCache.apply(this, [].slice.call(arguments).concat([force])); }; - + //save current scroll offset var currScroll = { x: _viewportElement[_strScrollLeft](), @@ -2248,7 +2248,7 @@ _sizeAutoObserverElementNative = _sizeAutoObserverElement[0]; _contentGlueElement.before(_sizeAutoObserverElement); - var oldSize = {w: -1, h: -1}; + var oldSize = { w: -1, h: -1 }; setupResizeObserver(_sizeAutoObserverElement, function () { var newSize = { w: _sizeAutoObserverElementNative[LEXICON.oW], @@ -2310,7 +2310,7 @@ b: parseToZeroOrNumber(_hostElement.css(_strPaddingMinus + _strBottom)), l: parseToZeroOrNumber(_hostElement.css(_strPaddingMinus + _strLeft)) }; - + //width + height auto detecting var: var sizeAutoObserverElementBCRect; //exception occurs in IE8 sometimes (unknown exception) @@ -2381,18 +2381,18 @@ }; //vars to apply correct css - var contentElementCSS = { }; - var contentGlueElementCSS = { }; + var contentElementCSS = {}; + var contentGlueElementCSS = {}; //funcs - var getHostSize = function() { + var getHostSize = function () { //has to be clientSize because offsetSize respect borders return { w: _hostElementNative[LEXICON.cW], h: _hostElementNative[LEXICON.cH] }; }; - var getViewportSize = function() { + var getViewportSize = function () { //viewport size is padding container because it never has padding, margin and a border //determine zoom rounding error -> sometimes scrollWidth/Height is smaller than clientWidth/Height //if this happens add the difference to the viewportSize to compensate the rounding error @@ -2437,7 +2437,7 @@ _cssBorderCache = border; _cssMarginCache = margin; _cssMaxValueCache = cssMaxValue; - + //IEFix direction changed if (cssDirectionChanged && _sizeAutoObserverAdded) _sizeAutoObserverElement.css(_strFloat, isRTLRight); @@ -2472,9 +2472,9 @@ var textareaSize = _isTextarea ? textareaUpdate() : false; var textareaSizeChanged = _isTextarea && checkCacheAutoForce(textareaSize, _textareaSizeCache); var textareaDynOrigSize = _isTextarea && textareaSize ? { - w : textareaDynWidth ? textareaSize._dynamicWidth : textareaSize._originalWidth, - h : textareaDynHeight ? textareaSize._dynamicHeight : textareaSize._originalHeight - } : { }; + w: textareaDynWidth ? textareaSize._dynamicWidth : textareaSize._originalWidth, + h: textareaDynHeight ? textareaSize._dynamicHeight : textareaSize._originalHeight + } : {}; _textareaSizeCache = textareaSize; //fix height auto / width auto in cooperation with current padding & boxSizing behavior: @@ -2546,19 +2546,19 @@ var strVisible = 'visible'; //decide whether the content overflow must get hidden for correct overflow measuring, it !MUST! be always hidden if the height is auto var hideOverflow4CorrectMeasuring = _restrictedMeasuring ? - (_nativeScrollbarIsOverlaid.x || _nativeScrollbarIsOverlaid.y) || //it must be hidden if native scrollbars are overlaid - (_viewportSize.w < _nativeScrollbarMinSize.y || _viewportSize.h < _nativeScrollbarMinSize.x) || //it must be hidden if host-element is too small - heightAuto || displayIsHiddenChanged //it must be hidden if height is auto or display was changed + (_nativeScrollbarIsOverlaid.x || _nativeScrollbarIsOverlaid.y) || //it must be hidden if native scrollbars are overlaid + (_viewportSize.w < _nativeScrollbarMinSize.y || _viewportSize.h < _nativeScrollbarMinSize.x) || //it must be hidden if host-element is too small + heightAuto || displayIsHiddenChanged //it must be hidden if height is auto or display was changed : heightAuto; //if there is not the restricted Measuring bug, it must be hidden if the height is auto //Reset the viewport (very important for natively overlaid scrollbars and zoom change //don't change the overflow prop as it is very expensive and affects performance !A LOT! - var viewportElementResetCSS = { }; + var viewportElementResetCSS = {}; var resetXTmp = _hasOverflowCache.y && _hideOverflowCache.ys && !ignoreOverlayScrollbarHiding && !_nativeScrollbarStyling ? (_nativeScrollbarIsOverlaid.y ? _viewportElement.css(isRTLLeft) : -_nativeScrollbarSize.y) : 0; var resetBottomTmp = _hasOverflowCache.x && _hideOverflowCache.xs && !ignoreOverlayScrollbarHiding && !_nativeScrollbarStyling ? (_nativeScrollbarIsOverlaid.x ? _viewportElement.css(_strBottom) : -_nativeScrollbarSize.x) : 0; setTopRightBottomLeft(viewportElementResetCSS, _strEmpty); _viewportElement.css(viewportElementResetCSS); - if(hideOverflow4CorrectMeasuring) + if (hideOverflow4CorrectMeasuring) _contentElement.css(strOverflow, strHidden); //measure several sizes: @@ -2600,7 +2600,7 @@ contentGlueElementCSS[_strHeight] = contentGlueSize.h; //textarea-sizes are already calculated correctly at this point - if(!_isTextarea) { + if (!_isTextarea) { contentSize = { //use clientSize because natively overlaidScrollbars add borders w: contentMeasureElement[LEXICON.cW], @@ -2609,7 +2609,7 @@ } } var textareaCoverCSS = {}; - var setContentGlueElementCSSfunction = function(horizontal) { + var setContentGlueElementCSSfunction = function (horizontal) { var scrollbarVars = getScrollbarVars(horizontal); var wh = scrollbarVars._w_h; var strWH = scrollbarVars._width_height; @@ -2663,9 +2663,9 @@ _contentScrollSizeCache = contentScrollSize; //remove overflow hidden to restore overflow - if(hideOverflow4CorrectMeasuring) + if (hideOverflow4CorrectMeasuring) _contentElement.css(strOverflow, _strEmpty); - + //refresh viewport size after correct measuring _viewportSize = getViewportSize(); @@ -2675,22 +2675,22 @@ var hideOverflowForceTextarea = _isTextarea && (_viewportSize.w === 0 || _viewportSize.h === 0); var previousOverflowAmount = _overflowAmountCache; - var overflowBehaviorIsVS = { }; - var overflowBehaviorIsVH = { }; - var overflowBehaviorIsS = { }; - var overflowAmount = { }; - var hasOverflow = { }; - var hideOverflow = { }; - var canScroll = { }; + var overflowBehaviorIsVS = {}; + var overflowBehaviorIsVH = {}; + var overflowBehaviorIsS = {}; + var overflowAmount = {}; + var hasOverflow = {}; + var hideOverflow = {}; + var canScroll = {}; var viewportRect = _paddingElementNative[LEXICON.bCR](); - var setOverflowVariables = function(horizontal) { + var setOverflowVariables = function (horizontal) { var scrollbarVars = getScrollbarVars(horizontal); var scrollbarVarsInverted = getScrollbarVars(!horizontal); var xyI = scrollbarVarsInverted._x_y; 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'; @@ -2721,8 +2721,8 @@ //if native scrollbar is overlay at x OR y axis, prepare DOM if (_nativeScrollbarIsOverlaid.x || _nativeScrollbarIsOverlaid.y) { var borderDesign = 'px solid transparent'; - var contentArrangeElementCSS = { }; - var arrangeContent = { }; + var contentArrangeElementCSS = {}; + var arrangeContent = {}; var arrangeChanged = force; var setContentElementCSS; @@ -2735,7 +2735,7 @@ if (hasOverflow.c || hideOverflow.c || contentScrollSize.c || cssDirectionChanged || widthAutoChanged || heightAutoChanged || widthAuto || heightAuto || ignoreOverlayScrollbarHidingChanged) { contentElementCSS[_strMarginMinus + isRTLRight] = contentElementCSS[_strBorderMinus + isRTLRight] = _strEmpty; - setContentElementCSS = function(horizontal) { + setContentElementCSS = function (horizontal) { var scrollbarVars = getScrollbarVars(horizontal); var scrollbarVarsInverted = getScrollbarVars(!horizontal); var xy = scrollbarVars._x_y; @@ -2748,14 +2748,14 @@ } else { arrangeContent[scrollbarVarsInverted._w_h] = - contentElementCSS[_strMarginMinus + strDirection] = - contentElementCSS[_strBorderMinus + strDirection] = _strEmpty; + contentElementCSS[_strMarginMinus + strDirection] = + contentElementCSS[_strBorderMinus + strDirection] = _strEmpty; arrangeChanged = true; } }; if (_nativeScrollbarStyling) { - if (ignoreOverlayScrollbarHiding) + if (ignoreOverlayScrollbarHiding) removeClass(_viewportElement, _classNameViewportNativeScrollbarsInvisible); else addClass(_viewportElement, _classNameViewportNativeScrollbarsInvisible); @@ -2787,7 +2787,7 @@ var setViewportCSS; if (hostSizeChanged || hasOverflow.c || hideOverflow.c || contentScrollSize.c || overflowBehaviorChanged || boxSizingChanged || ignoreOverlayScrollbarHidingChanged || cssDirectionChanged || clipAlwaysChanged || heightAutoChanged) { viewportElementCSS[isRTLRight] = _strEmpty; - setViewportCSS = function(horizontal) { + setViewportCSS = function (horizontal) { var scrollbarVars = getScrollbarVars(horizontal); var scrollbarVarsInverted = getScrollbarVars(!horizontal); var xy = scrollbarVars._x_y; @@ -2804,7 +2804,7 @@ reset(); } else { - viewportElementCSS[strDirection] = -(_nativeScrollbarIsOverlaid[xy] ? _overlayScrollbarDummySize[xy] : _nativeScrollbarSize[xy]); + viewportElementCSS[strDirection] = -(_nativeScrollbarIsOverlaid[xy] ? _overlayScrollbarDummySize[xy] : _nativeScrollbarSize[xy]); _contentBorderSize[scrollbarVarsInverted._w_h] = _nativeScrollbarIsOverlaid[xy] ? _overlayScrollbarDummySize[scrollbarVarsInverted._x_y] : 0; } } else { @@ -2814,13 +2814,13 @@ }; setViewportCSS(true); setViewportCSS(false); - + // if the scroll container is too small and if there is any overflow with no overlay scrollbar (and scrollbar styling isn't possible), // make viewport element greater in size (Firefox hide Scrollbars fix) // because firefox starts hiding scrollbars on too small elements // with this behavior the overflow calculation may be incorrect or the scrollbars would appear suddenly // https://bugzilla.mozilla.org/show_bug.cgi?id=292284 - if (!_nativeScrollbarStyling + if (!_nativeScrollbarStyling && (_viewportSize.h < _nativeScrollbarMinSize.x || _viewportSize.w < _nativeScrollbarMinSize.y) && ((hasOverflow.x && hideOverflow.x && !_nativeScrollbarIsOverlaid.x) || (hasOverflow.y && hideOverflow.y && !_nativeScrollbarIsOverlaid.y))) { viewportElementCSS[_strPaddingMinus + _strTop] = _nativeScrollbarMinSize.x; @@ -2831,19 +2831,19 @@ } else { viewportElementCSS[_strPaddingMinus + _strTop] = - viewportElementCSS[_strMarginMinus + _strTop] = - viewportElementCSS[_strPaddingMinus + isRTLRight] = - viewportElementCSS[_strMarginMinus + isRTLRight] = _strEmpty; + viewportElementCSS[_strMarginMinus + _strTop] = + viewportElementCSS[_strPaddingMinus + isRTLRight] = + viewportElementCSS[_strMarginMinus + isRTLRight] = _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 ((hasOverflow.x && hideOverflow.x) || (hasOverflow.y && hideOverflow.y) || hideOverflowForceTextarea) { //only hide if is Textarea if (_isTextarea && hideOverflowForceTextarea) { paddingElementCSS[strOverflowX] = - paddingElementCSS[strOverflowY] = strHidden; + paddingElementCSS[strOverflowY] = strHidden; } } else { @@ -2851,16 +2851,16 @@ //only un-hide if Textarea if (_isTextarea) { paddingElementCSS[strOverflowX] = - paddingElementCSS[strOverflowY] = _strEmpty; + paddingElementCSS[strOverflowY] = _strEmpty; } viewportElementCSS[strOverflowX] = - viewportElementCSS[strOverflowY] = strVisible; + viewportElementCSS[strOverflowY] = strVisible; } } _paddingElement.css(paddingElementCSS); _viewportElement.css(viewportElementCSS); - viewportElementCSS = { }; + viewportElementCSS = {}; //force soft redraw in webkit because without the scrollbars will may appear because DOM wont be redrawn under special conditions if ((hasOverflow.c || boxSizingChanged || widthAutoChanged || heightAutoChanged) && !(_nativeScrollbarIsOverlaid.x && _nativeScrollbarIsOverlaid.y)) { @@ -2925,9 +2925,9 @@ } if (_isRTL && _rtlScrollBehavior.i && _nativeScrollbarIsOverlaid.y && hasOverflow.x && _normalizeRTLCache) currScroll.x += _contentBorderSize.w || 0; - if(widthAuto) + if (widthAuto) _hostElement[_strScrollLeft](0); - if(heightAuto) + if (heightAuto) _hostElement[_strScrollTop](0); _viewportElement[_strScrollLeft](currScroll.x)[_strScrollTop](currScroll.y); @@ -2967,11 +2967,11 @@ if (_isBody) addClass(_hostElement, _classNameHostResizeDisabled); if (resizeChanged) { - removeClass(_scrollbarCornerElement, [ - _classNameScrollbarCornerResize, - _classNameScrollbarCornerResizeB, - _classNameScrollbarCornerResizeH, - _classNameScrollbarCornerResizeV].join(_strSpace)); + removeClass(_scrollbarCornerElement, [ + _classNameScrollbarCornerResize, + _classNameScrollbarCornerResizeB, + _classNameScrollbarCornerResizeH, + _classNameScrollbarCornerResizeV].join(_strSpace)); if (_resizeNone) { addClass(_hostElement, _classNameHostResizeDisabled); } @@ -3103,7 +3103,7 @@ dispatchCallback('onUpdated', { forced: force }); } - + //==== Options ====// /** @@ -3116,7 +3116,7 @@ _currentOptions = extendDeep({}, _currentOptions, validatedOpts._default); _currentPreparedOptions = extendDeep({}, _currentPreparedOptions, validatedOpts._prepared); - + return validatedOpts._prepared; } @@ -3133,12 +3133,12 @@ var classNameTextareaElementFull = _classNameTextareaElement + _strSpace + _classNameTextInherit; var textareaClass = _isTextarea ? _strSpace + _classNameTextInherit : _strEmpty; var adoptAttrs = _currentPreparedOptions.textarea.inheritedAttrs; - var adoptAttrsMap = { }; - var applyAdoptedAttrs = function() { + var adoptAttrsMap = {}; + var applyAdoptedAttrs = function () { var applyAdoptedAttrsElm = destroy ? _targetElement : _hostElement; - each(adoptAttrsMap, function(key, value) { - if(type(value) == TYPES.s) { - if(key == LEXICON.c) + each(adoptAttrsMap, function (key, value) { + if (type(value) == TYPES.s) { + if (key == LEXICON.c) applyAdoptedAttrsElm.addClass(value); else applyAdoptedAttrsElm.attr(key, value); @@ -3161,8 +3161,8 @@ _classNameTextareaElement, _classNameTextInherit, _classNameCache].join(_strSpace); - var hostElementCSS = { }; - + var hostElementCSS = {}; + //get host element as first element, because that's the most upper element and required for the other elements _hostElement = _hostElement || (_isTextarea ? (_domExists ? _targetElement[strParent]()[strParent]()[strParent]()[strParent]() : FRAMEWORK(generateDiv(_classNameHostTextareaElement))) : _targetElement); _contentElement = _contentElement || selectOrGenerateDivByClass(_classNameContentElement + textareaClass); @@ -3170,37 +3170,37 @@ _paddingElement = _paddingElement || selectOrGenerateDivByClass(_classNamePaddingElement + textareaClass); _sizeObserverElement = _sizeObserverElement || selectOrGenerateDivByClass(classNameResizeObserverHost); _textareaCoverElement = _textareaCoverElement || (_isTextarea ? selectOrGenerateDivByClass(_classNameTextareaCoverElement) : undefined); - + //on destroy, remove all generated class names from the host element before collecting the adopted attributes //to prevent adopting generated class names - if(destroy) + if (destroy) removeClass(_hostElement, hostElementClassNames); - + //collect all adopted attributes adoptAttrs = type(adoptAttrs) == TYPES.s ? adoptAttrs.split(_strSpace) : adoptAttrs; - if(type(adoptAttrs) == TYPES.a && _isTextarea) { - each(adoptAttrs, function(i, v) { - if(type(v) == TYPES.s) { + if (type(adoptAttrs) == TYPES.a && _isTextarea) { + each(adoptAttrs, function (i, v) { + if (type(v) == TYPES.s) { adoptAttrsMap[v] = destroy ? _hostElement.attr(v) : _targetElement.attr(v); } }); } - if(!destroy) { - if(_isTextarea) { - if(!_currentPreparedOptions.sizeAutoCapable) { + if (!destroy) { + if (_isTextarea) { + if (!_currentPreparedOptions.sizeAutoCapable) { hostElementCSS[_strWidth] = _targetElement.css(_strWidth); hostElementCSS[_strHeight] = _targetElement.css(_strHeight); } - - if(!_domExists) + + if (!_domExists) _targetElement.addClass(_classNameTextInherit).wrap(_hostElement); - + //jQuery clones elements in wrap functions, so we have to select them again _hostElement = _targetElement[strParent]().css(hostElementCSS); } - - if(!_domExists) { + + if (!_domExists) { //add the correct class to the target element addClass(_targetElement, _isTextarea ? classNameTextareaElementFull : _classNameHostElement); @@ -3209,21 +3209,21 @@ .wrapInner(_viewportElement) .wrapInner(_paddingElement) .prepend(_sizeObserverElement); - + //jQuery clones elements in wrap functions, so we have to select them again _contentElement = findFirst(_hostElement, _strDot + _classNameContentElement); _viewportElement = findFirst(_hostElement, _strDot + _classNameViewportElement); _paddingElement = findFirst(_hostElement, _strDot + _classNamePaddingElement); - - if(_isTextarea) { + + if (_isTextarea) { _contentElement.prepend(_textareaCoverElement); applyAdoptedAttrs(); } } - + if (_nativeScrollbarStyling) addClass(_viewportElement, _classNameViewportNativeScrollbarsInvisible); - if(_nativeScrollbarIsOverlaid.x && _nativeScrollbarIsOverlaid.y) + if (_nativeScrollbarIsOverlaid.x && _nativeScrollbarIsOverlaid.y) addClass(_viewportElement, _classNameViewportNativeScrollbarsOverlaid); if (_isBody) addClass(_htmlElement, _classNameHTMLElement); @@ -3235,41 +3235,41 @@ _contentElementNative = _contentElement[0]; } else { - if(_domExists && _initialized) { + if (_domExists && _initialized) { //clear size observer _sizeObserverElement.children().remove(); - + //remove the style property and classes from already generated elements - each([ _paddingElement, _viewportElement, _contentElement, _textareaCoverElement ], function(i, elm) { - if(elm) { + each([_paddingElement, _viewportElement, _contentElement, _textareaCoverElement], function (i, elm) { + if (elm) { removeClass(elm.removeAttr(LEXICON.s), _classNamesDynamicDestroy); } }); - + //add classes to the host element which was removed previously to match the expected DOM addClass(_hostElement, _isTextarea ? _classNameHostTextareaElement : _classNameHostElement); } else { //remove size observer remove(_sizeObserverElement); - + //unwrap the content to restore DOM _contentElement.contents() .unwrap() .unwrap() .unwrap(); - - if(_isTextarea) { + + if (_isTextarea) { _targetElement.unwrap(); remove(_hostElement); remove(_textareaCoverElement); applyAdoptedAttrs(); } } - + if (_isTextarea) _targetElement.removeAttr(LEXICON.s); - + if (_isBody) removeClass(_htmlElement, _classNameHTMLElement); } @@ -3286,7 +3286,7 @@ 37, 38, 39, 40, //left, up, right, down arrows 16, 17, 18, 19, 20, 144 //Shift, Ctrl, Alt, Pause, CapsLock, NumLock ]; - var textareaKeyDownKeyCodesList = [ ]; + var textareaKeyDownKeyCodesList = []; var textareaUpdateIntervalID; var scrollStopTimeoutId; var scrollStopDelay = 175; @@ -3295,7 +3295,7 @@ function updateTextarea(doClearInterval) { textareaUpdate(); _base.update(_strAuto); - if(doClearInterval && _autoUpdateRecommended) + if (doClearInterval && _autoUpdateRecommended) clearInterval(textareaUpdateIntervalID); } function textareaOnScroll(event) { @@ -3307,7 +3307,7 @@ } function textareaOnDrop(event) { setTimeout(function () { - if(!_destroyed) + if (!_destroyed) updateTextarea(); }, 50); } @@ -3317,13 +3317,13 @@ } function textareaOnFocusout() { _textareaHasFocus = false; - textareaKeyDownKeyCodesList = [ ]; + textareaKeyDownKeyCodesList = []; removeClass(_hostElement, strFocus); updateTextarea(true); - } + } function textareaOnKeyDown(event) { var keyCode = event.keyCode; - + if (inArray(keyCode, textareaKeyDownRestrictedKeyCodes) < 0) { if (!textareaKeyDownKeyCodesList[LEXICON.l]) { updateTextarea(); @@ -3343,7 +3343,7 @@ if (!textareaKeyDownKeyCodesList[LEXICON.l]) updateTextarea(true); } - } + } function contentOnTransitionEnd(event) { if (_autoUpdateCache === true) return; @@ -3368,14 +3368,14 @@ //if a scrollbars handle gets dragged, the mousemove event is responsible for refreshing the handle offset //because if CSS scroll-snap is used, the handle offset gets only refreshed on every snap point //this looks laggy & clunky, it looks much better if the offset refreshes with the mousemove - if(!_scrollbarsHandlesDefineScrollPos) { + if (!_scrollbarsHandlesDefineScrollPos) { refreshScrollbarHandleOffset(true); refreshScrollbarHandleOffset(false); } dispatchCallback('onScroll', event); scrollStopTimeoutId = setTimeout(function () { - if(!_destroyed) { + if (!_destroyed) { //OnScrollStop: clearTimeout(scrollStopTimeoutId); scrollStopTimeoutId = undefined; @@ -3393,19 +3393,19 @@ } - if (_isTextarea) { + if (_isTextarea) { if (_msieVersion > 9 || !_autoUpdateRecommended) { addDestroyEventListener(_targetElement, 'input', updateTextarea); } else { - addDestroyEventListener(_targetElement, - [ _strKeyDownEvent, _strKeyUpEvent ], - [ textareaOnKeyDown, textareaOnKeyUp ]); + addDestroyEventListener(_targetElement, + [_strKeyDownEvent, _strKeyUpEvent], + [textareaOnKeyDown, textareaOnKeyUp]); } - - addDestroyEventListener(_targetElement, - [ _strScroll, 'drop', strFocus, strFocus + 'out' ], - [ textareaOnScroll, textareaOnDrop, textareaOnFocus, textareaOnFocusout ]); + + addDestroyEventListener(_targetElement, + [_strScroll, 'drop', strFocus, strFocus + 'out'], + [textareaOnScroll, textareaOnDrop, textareaOnFocus, textareaOnFocusout]); } else { addDestroyEventListener(_contentElement, _strTransitionEndEvent, contentOnTransitionEnd); @@ -3421,17 +3421,17 @@ * @param destroy Indicates whether the DOM shall be build or destroyed. */ function setupScrollbarsDOM(destroy) { - var selectOrGenerateScrollbarDOM = function(isHorizontal) { + var selectOrGenerateScrollbarDOM = function (isHorizontal) { var scrollbarClassName = isHorizontal ? _classNameScrollbarHorizontal : _classNameScrollbarVertical; var scrollbar = selectOrGenerateDivByClass(_classNameScrollbar + _strSpace + scrollbarClassName, true); var track = selectOrGenerateDivByClass(_classNameScrollbarTrack, scrollbar); var handle = selectOrGenerateDivByClass(_classNameScrollbarHandle, scrollbar); - if(!_domExists && !destroy) { + if (!_domExists && !destroy) { scrollbar.append(track); track.append(handle); } - + return { _scrollbar: scrollbar, _track: track, @@ -3443,9 +3443,9 @@ var scrollbar = scrollbarVars._scrollbar; var track = scrollbarVars._track; var handle = scrollbarVars._handle; - - if(_domExists && _initialized) { - each([ scrollbar, track, handle ], function(i, elm) { + + if (_domExists && _initialized) { + each([scrollbar, track, handle], function (i, elm) { removeClass(elm.removeAttr(LEXICON.s), _classNamesDynamicDestroy); }); } @@ -3455,11 +3455,11 @@ } var horizontalElements; var verticalElements; - - if(!destroy) { + + if (!destroy) { horizontalElements = selectOrGenerateScrollbarDOM(true); verticalElements = selectOrGenerateScrollbarDOM(); - + _scrollbarHorizontalElement = horizontalElements._scrollbar; _scrollbarHorizontalTrackElement = horizontalElements._track; _scrollbarHorizontalHandleElement = horizontalElements._handle; @@ -3467,7 +3467,7 @@ _scrollbarVerticalTrackElement = verticalElements._track; _scrollbarVerticalHandleElement = verticalElements._handle; - if(!_domExists) { + if (!_domExists) { _paddingElement.after(_scrollbarVerticalElement); _paddingElement.after(_scrollbarHorizontalElement); } @@ -3492,12 +3492,12 @@ var strActive = 'active'; var strSnapHandle = 'snapHandle'; var scrollDurationFactor = 1; - var increaseDecreaseScrollAmountKeyCodes = [ 16, 17 ]; //shift, ctrl + var increaseDecreaseScrollAmountKeyCodes = [16, 17]; //shift, ctrl var trackTimeout; var mouseDownScroll; var mouseDownOffset; var mouseDownInvertedScale; - + function getPointerPosition(event) { return _msieVersion && insideIFrame ? event['screen' + XY] : COMPATIBILITY.page(event)[xy]; //use screen coordinates in EDGE & IE because the page values are incorrect in frames. } @@ -3524,7 +3524,7 @@ return _sleeping || _destroyed || nativeOverlayScrollbarsAreActive() || !_scrollbarsDragScrollingCache || (isTouchEvent && !getPreparedScrollbarsOption('touchSupport')) ? false : COMPATIBILITY.mBtn(event) === 1 || isTouchEvent; } function documentDragMove(event) { - if(onMouseTouchDownContinue(event)) { + if (onMouseTouchDownContinue(event)) { var trackLength = scrollbarVarsInfo._trackLength; var handleLength = scrollbarVarsInfo._handleLength; var scrollRange = scrollbarVarsInfo._maxScroll; @@ -3537,7 +3537,7 @@ _viewportElement[scroll](MATH.round(mouseDownScroll + scrollDelta)); - if(_scrollbarsHandlesDefineScrollPos) + if (_scrollbarsHandlesDefineScrollPos) refreshScrollbarHandleOffset(isHorizontal, mouseDownScroll + scrollDelta); if (!_supportPassiveEvents) @@ -3550,11 +3550,11 @@ event = event || event.originalEvent; setupResponsiveEventListener(_documentElement, - [ _strMouseTouchMoveEvent, _strMouseTouchUpEvent, _strKeyDownEvent, _strKeyUpEvent, _strSelectStartEvent ], - [ documentDragMove, documentMouseTouchUp, documentKeyDown, documentKeyUp, documentOnSelectStart ], + [_strMouseTouchMoveEvent, _strMouseTouchUpEvent, _strKeyDownEvent, _strKeyUpEvent, _strSelectStartEvent], + [documentDragMove, documentMouseTouchUp, documentKeyDown, documentKeyUp, documentOnSelectStart], true); - if(_scrollbarsHandlesDefineScrollPos) + if (_scrollbarsHandlesDefineScrollPos) refreshScrollbarHandleOffset(isHorizontal, true); _scrollbarsHandlesDefineScrollPos = false; @@ -3575,7 +3575,7 @@ trackTimeout = undefined; } - if(event) { + if (event) { var rect = _hostElementNative[LEXICON.bCR](); var mouseInsideHost = event.clientX >= rect.left && event.clientX <= rect.right && event.clientY >= rect.top && event.clientY <= rect.bottom; @@ -3606,10 +3606,10 @@ addClass(scrollbarVars._scrollbar, strActive); setupResponsiveEventListener(_documentElement, - [ _strMouseTouchMoveEvent, _strMouseTouchUpEvent, _strSelectStartEvent ], - [ documentDragMove, documentMouseTouchUp, documentOnSelectStart ]); + [_strMouseTouchMoveEvent, _strMouseTouchUpEvent, _strSelectStartEvent], + [documentDragMove, documentMouseTouchUp, documentOnSelectStart]); - if(_msieVersion || !_documentMixed) + if (_msieVersion || !_documentMixed) COMPATIBILITY.prvD(event); COMPATIBILITY.stpP(event); } @@ -3624,16 +3624,16 @@ var easing = 'linear'; var decreaseScroll; var finishedCondition; - var scrollActionFinsished = function(transition) { - if(_scrollbarsHandlesDefineScrollPos) + var scrollActionFinsished = function (transition) { + if (_scrollbarsHandlesDefineScrollPos) refreshScrollbarHandleOffset(isHorizontal, transition); }; - var scrollActionInstantFinished = function() { + var scrollActionInstantFinished = function () { scrollActionFinsished(); onHandleMouseTouchDownAction(event); }; var scrollAction = function () { - if(!_destroyed) { + if (!_destroyed) { var mouseOffset = (mouseDownOffset - trackOffset) * mouseDownInvertedScale; var handleOffset = scrollbarVarsInfo._handleOffset; var trackLength = scrollbarVarsInfo._trackLength; @@ -3645,11 +3645,11 @@ var instantScrollPosition = scrollRange * ((mouseOffset - (handleLength / 2)) / (trackLength - handleLength)); // 100% * positionPercent var rtlIsNormal = _isRTL && isHorizontal && ((!_rtlScrollBehavior.i && !_rtlScrollBehavior.n) || _normalizeRTLCache); var decreaseScrollCondition = rtlIsNormal ? handleOffset < mouseOffset : handleOffset > mouseOffset; - var scrollObj = { }; + var scrollObj = {}; var animationObj = { - easing : easing, - step : function(now) { - if(_scrollbarsHandlesDefineScrollPos) { + easing: easing, + step: function (now) { + if (_scrollbarsHandlesDefineScrollPos) { _viewportElement[scroll](now); //https://github.com/jquery/jquery/issues/4340 refreshScrollbarHandleOffset(isHorizontal, now); } @@ -3660,9 +3660,9 @@ //_base.scrollStop(); - if(instantScroll) { + if (instantScroll) { _viewportElement[scroll](instantScrollPosition); //scroll instantly to new position - if(instantScrollTransition) { + if (instantScrollTransition) { //get the scroll position after instant scroll (in case CSS Snap Points are used) to get the correct snapped scroll position //and the animation stops at the correct point instantScrollPosition = _viewportElement[scroll](); @@ -3674,8 +3674,8 @@ scrollObj[xy] = instantScrollPosition; _base.scroll(scrollObj, extendDeep(animationObj, { - duration : 130, - complete : scrollActionInstantFinished + duration: 130, + complete: scrollActionInstantFinished })); } else @@ -3717,8 +3717,8 @@ addClass(scrollbarVars._scrollbar, strActive); setupResponsiveEventListener(_documentElement, - [ _strMouseTouchUpEvent, _strKeyDownEvent, _strKeyUpEvent, _strSelectStartEvent ], - [ documentMouseTouchUp, documentKeyDown, documentKeyUp, documentOnSelectStart ]); + [_strMouseTouchUpEvent, _strKeyDownEvent, _strKeyUpEvent, _strSelectStartEvent], + [documentMouseTouchUp, documentKeyDown, documentKeyUp, documentOnSelectStart]); scrollAction(); COMPATIBILITY.prvD(event); @@ -3739,19 +3739,19 @@ function onScrollbarMouseTouchDown(event) { COMPATIBILITY.stpP(event); } - - addDestroyEventListener(scrollbarVars._handle, - _strMouseTouchDownEvent, + + addDestroyEventListener(scrollbarVars._handle, + _strMouseTouchDownEvent, onHandleMouseTouchDown); addDestroyEventListener(scrollbarVars._track, - [_strMouseTouchDownEvent, _strMouseTouchEnter, _strMouseTouchLeave], + [_strMouseTouchDownEvent, _strMouseTouchEnter, _strMouseTouchLeave], [onTrackMouseTouchDown, onTrackMouseTouchEnter, onTrackMouseTouchLeave]); - addDestroyEventListener(scrollbarVars._scrollbar, - _strMouseTouchDownEvent, + addDestroyEventListener(scrollbarVars._scrollbar, + _strMouseTouchDownEvent, onScrollbarMouseTouchDown); if (_supportTransition) { - addDestroyEventListener(scrollbarVars._scrollbar, _strTransitionEndEvent, function(event) { + addDestroyEventListener(scrollbarVars._scrollbar, _strTransitionEndEvent, function (event) { if (event.target !== scrollbarVars._scrollbar[0]) return; refreshScrollbarHandleLength(isHorizontal); @@ -3863,10 +3863,10 @@ // because its a bit behind during the small delay when content size updates //(delay = mutationObserverContentLag, if its 0 then this var could be used) var maxScroll = (_viewportElementNative[_strScroll + scrollbarVars._Width_Height] - _viewportElementNative['client' + scrollbarVars._Width_Height]) * (_rtlScrollBehavior.n && isRTLisHorizontal ? -1 : 1); //* -1 if rtl scroll max is negative - var getScrollRatio = function(base) { + var getScrollRatio = function (base) { return isNaN(base / maxScroll) ? 0 : MATH.max(0, MATH.min(1, base / maxScroll)); }; - var getHandleOffset = function(scrollRatio) { + var getHandleOffset = function (scrollRatio) { var offset = handleTrackDiff * scrollRatio; offset = isNaN(offset) ? 0 : offset; offset = (isRTLisHorizontal && !_rtlScrollBehavior.i) ? (trackLength - handleLength - offset) : offset; @@ -3890,8 +3890,8 @@ handleCSS[strTransform] = translateValue; //apply or clear up transition - if(_supportTransition) - handleCSS[strTransition] = transition && MATH.abs(handleOffset - scrollbarVarsInfo._handleOffset) > 1 ? getCSSTransitionString(scrollbarVars._handle) + ', ' + (strTransform + _strSpace + transitionDuration + 'ms') : _strEmpty; + if (_supportTransition) + handleCSS[strTransition] = transition && MATH.abs(handleOffset - scrollbarVarsInfo._handleOffset) > 1 ? getCSSTransitionString(scrollbarVars._handle) + ', ' + (strTransform + _strSpace + transitionDuration + 'ms') : _strEmpty; } else handleCSS[scrollbarVars._left_top] = handleOffset; @@ -3902,9 +3902,9 @@ scrollbarVars._handle.css(handleCSS); //clear up transition - if(_supportTransform && _supportTransition && transition) { - scrollbarVars._handle.one(_strTransitionEndEvent, function() { - if(!_destroyed) + if (_supportTransform && _supportTransition && transition) { + scrollbarVars._handle.one(_strTransitionEndEvent, function () { + if (!_destroyed) scrollbarVars._handle.css(strTransition, _strEmpty); }); } @@ -3961,36 +3961,36 @@ */ function setupScrollbarCornerDOM(destroy) { _scrollbarCornerElement = _scrollbarCornerElement || selectOrGenerateDivByClass(_classNameScrollbarCorner, true); - - if(!destroy) { - if(!_domExists) { + + if (!destroy) { + if (!_domExists) { _hostElement.append(_scrollbarCornerElement); } } else { - if(_domExists && _initialized) { + if (_domExists && _initialized) { removeClass(_scrollbarCornerElement.removeAttr(LEXICON.s), _classNamesDynamicDestroy); } else { remove(_scrollbarCornerElement); } } - } + } /** * Initializes all scrollbar corner interactivity events. */ function setupScrollbarCornerEvents() { var insideIFrame = _windowElementNative.top !== _windowElementNative; - var mouseDownPosition = { }; - var mouseDownSize = { }; - var mouseDownInvertedScale = { }; + var mouseDownPosition = {}; + var mouseDownSize = {}; + var mouseDownInvertedScale = {}; var reconnectMutationObserver; - + function documentDragMove(event) { if (onMouseTouchDownContinue(event)) { var pageOffset = getCoordinates(event); - var hostElementCSS = { }; + var hostElementCSS = {}; if (_resizeHorizontal || _resizeBoth) hostElementCSS[_strWidth] = (mouseDownSize.w + (pageOffset.x - mouseDownPosition.x) * mouseDownInvertedScale.x); if (_resizeVertical || _resizeBoth) @@ -4006,9 +4006,9 @@ var eventIsTrusted = event !== undefined; setupResponsiveEventListener(_documentElement, - [ _strSelectStartEvent, _strMouseTouchMoveEvent, _strMouseTouchUpEvent ], - [ documentOnSelectStart, documentDragMove, documentMouseTouchUp ], - true); + [_strSelectStartEvent, _strMouseTouchMoveEvent, _strMouseTouchUpEvent], + [documentOnSelectStart, documentDragMove, documentMouseTouchUp], + true); removeClass(_bodyElement, _classNameDragging); if (_scrollbarCornerElement.releaseCapture) @@ -4027,10 +4027,10 @@ return _sleeping || _destroyed ? false : COMPATIBILITY.mBtn(event) === 1 || isTouchEvent; } function getCoordinates(event) { - return _msieVersion && insideIFrame ? { x : event.screenX , y : event.screenY } : COMPATIBILITY.page(event); + return _msieVersion && insideIFrame ? { x: event.screenX, y: event.screenY } : COMPATIBILITY.page(event); } - - addDestroyEventListener(_scrollbarCornerElement, _strMouseTouchDownEvent, function(event) { + + addDestroyEventListener(_scrollbarCornerElement, _strMouseTouchDownEvent, function (event) { if (onMouseTouchDownContinue(event) && !_resizeNone) { if (_mutationObserversConnected) { reconnectMutationObserver = true; @@ -4044,8 +4044,8 @@ mouseDownInvertedScale = getHostElementInvertedScale(); setupResponsiveEventListener(_documentElement, - [ _strSelectStartEvent, _strMouseTouchMoveEvent, _strMouseTouchUpEvent ], - [ documentOnSelectStart, documentDragMove, documentMouseTouchUp ]); + [_strSelectStartEvent, _strMouseTouchMoveEvent, _strMouseTouchUpEvent], + [documentOnSelectStart, documentDragMove, documentMouseTouchUp]); addClass(_bodyElement, _classNameDragging); if (_scrollbarCornerElement.setCapture) @@ -4066,25 +4066,25 @@ * @param args The args with which the callback shall be called. */ function dispatchCallback(name, args) { - if(_initialized) { + if (_initialized) { var callback = _currentPreparedOptions.callbacks[name]; var extensionOnName = name; var ext; - if(extensionOnName.substr(0, 2) === 'on') + if (extensionOnName.substr(0, 2) === 'on') extensionOnName = extensionOnName.substr(2, 1).toLowerCase() + extensionOnName.substr(3); - if(type(callback) == TYPES.f) + if (type(callback) == TYPES.f) callback.call(_base, args); - each(_extensions, function() { + each(_extensions, function () { ext = this; - if(type(ext.on) == TYPES.f) + if (type(ext.on) == TYPES.f) ext.on(extensionOnName, args); }); } - else if(!_destroyed) - _callbacksInitQeueue.push({ n : name, a : args }); + else if (!_destroyed) + _callbacksInitQeueue.push({ n: name, a: args }); } /** @@ -4112,19 +4112,19 @@ function getCSSTransitionString(element) { var transitionStr = VENDORS._cssProperty('transition'); var assembledValue = element.css(transitionStr); - if(assembledValue) + if (assembledValue) return assembledValue; var regExpString = '\\s*(' + '([^,(]+(\\(.+?\\))?)+' + ')[\\s,]*'; var regExpMain = new RegExp(regExpString); var regExpValidate = new RegExp('^(' + regExpString + ')+$'); var properties = 'property duration timing-function delay'.split(' '); - var result = [ ]; + var result = []; var strResult; var valueArray; var i = 0; var j; - var splitCssStyleByComma = function(str) { - strResult = [ ]; + var splitCssStyleByComma = function (str) { + strResult = []; if (!str.match(regExpValidate)) return str; while (str.match(regExpMain)) { @@ -4149,8 +4149,8 @@ function getHostElementInvertedScale() { var rect = _paddingElementNative[LEXICON.bCR](); return { - x : _supportTransform ? 1 / (MATH.round(rect.width) / _paddingElementNative[LEXICON.oW]) || 1 : 1, - y : _supportTransform ? 1 / (MATH.round(rect.height) / _paddingElementNative[LEXICON.oH]) || 1 : 1 + x: _supportTransform ? 1 / (MATH.round(rect.width) / _paddingElementNative[LEXICON.oW]) || 1 : 1, + y: _supportTransform ? 1 / (MATH.round(rect.height) / _paddingElementNative[LEXICON.oH]) || 1 : 1 }; } @@ -4165,7 +4165,7 @@ var wnd = o && o[strOwnerDocument] ? (o[strOwnerDocument].parentWindow || window) : window; return ( typeof wnd[strHTMLElement] == TYPES.o ? o instanceof wnd[strHTMLElement] : //DOM2 - o && typeof o == TYPES.o && o !== null && o.nodeType === 1 && typeof o.nodeName == TYPES.s + o && typeof o == TYPES.o && o !== null && o.nodeType === 1 && typeof o.nodeName == TYPES.s ); } @@ -4176,8 +4176,8 @@ * @returns {Array} The differences between the two arrays. */ function getArrayDifferences(a1, a2) { - var a = [ ]; - var diff = [ ]; + var a = []; + var diff = []; var i; var k; for (i = 0; i < a1.length; i++) @@ -4270,21 +4270,21 @@ function generateDiv(classesOrAttrs, content) { return '
' + (content || _strEmpty) + '
'; } - + /** * Selects or generates a div with the given class attribute. * @param className The class names (divided by spaces) of the div which shall be selected or generated. @@ -4295,14 +4295,14 @@ function selectOrGenerateDivByClass(className, selectParentOrOnlyChildren) { var onlyChildren = type(selectParentOrOnlyChildren) == TYPES.b; var selectParent = onlyChildren ? _hostElement : (selectParentOrOnlyChildren || _hostElement); - - return (_domExists && !selectParent[LEXICON.l]) + + return (_domExists && !selectParent[LEXICON.l]) ? null - : _domExists + : _domExists ? selectParent[onlyChildren ? 'children' : 'find'](_strDot + className.replace(/\s/g, _strDot)).eq(0) : FRAMEWORK(generateDiv(className)) } - + /** * Gets the value of the given property from the given object. * @param obj The object from which the property value shall be got. @@ -4313,11 +4313,11 @@ var splits = path.split(_strDot); var i = 0; var val; - for(; i < splits.length; i++) { - if(!obj[LEXICON.hOP](splits[i])) + for (; i < splits.length; i++) { + if (!obj[LEXICON.hOP](splits[i])) return; val = obj[splits[i]]; - if(i < splits.length && type(val) == TYPES.o) + if (i < splits.length && type(val) == TYPES.o) obj = val; } return val; @@ -4333,10 +4333,10 @@ var splits = path.split(_strDot); var splitsLength = splits.length; var i = 0; - var extendObj = { }; + var extendObj = {}; var extendObjRoot = extendObj; - for(; i < splitsLength; i++) - extendObj = extendObj[splits[i]] = i + 1 < splitsLength ? { } : val; + for (; i < splitsLength; i++) + extendObj = extendObj[splits[i]] = i + 1 < splitsLength ? {} : val; FRAMEWORK.extend(obj, extendObjRoot, true); } @@ -4353,11 +4353,11 @@ function checkCache(current, cache, force) { if (force) return force; - if(type(current) == TYPES.o && type(cache) == TYPES.o) { + if (type(current) == TYPES.o && type(cache) == TYPES.o) { for (var prop in current) { - if(prop !== 'c') { + if (prop !== 'c') { if (current[LEXICON.hOP](prop) && cache[LEXICON.hOP](prop)) { - if(checkCache(current[prop], cache[prop])) + if (checkCache(current[prop], cache[prop])) return true; } else { @@ -4379,7 +4379,7 @@ * jQuery extend method shortcut with a appended "true" as first argument. */ function extendDeep() { - return FRAMEWORK.extend.apply(this, [ true ].concat([].slice.call(arguments))); + return FRAMEWORK.extend.apply(this, [true].concat([].slice.call(arguments))); } /** @@ -4438,9 +4438,9 @@ * undefined otherwise. */ _base.update = function (force) { - if(_destroyed) + if (_destroyed) return; - + var attrsChanged; var contentSizeC; var isString = type(force) == TYPES.s; @@ -4449,21 +4449,21 @@ var doUpdateAuto; var mutHost; var mutContent; - - if(isString) { + + if (isString) { if (force === _strAuto) { attrsChanged = meaningfulAttrsChanged(); contentSizeC = updateAutoContentSizeChanged(); doUpdateAuto = attrsChanged || contentSizeC; if (doUpdateAuto) { update({ - _contentSizeChanged : contentSizeC, - _changedOptions : _initialized ? undefined : _currentPreparedOptions + _contentSizeChanged: contentSizeC, + _changedOptions: _initialized ? undefined : _currentPreparedOptions }); } } else if (force === _strSync) { - if(_mutationObserversConnected) { + if (_mutationObserversConnected) { mutHost = _mutationObserverHostCallback(_mutationObserverHost.takeRecords()); mutContent = _mutationObserverContentCallback(_mutationObserverContent.takeRecords()); } @@ -4473,19 +4473,19 @@ } else if (force === 'zoom') { update({ - _hostSizeChanged : true, - _contentSizeChanged : true + _hostSizeChanged: true, + _contentSizeChanged: true }); } } else { force = _sleeping || force; _sleeping = false; - if(!_base.update(_strSync) || force) - update({ _force : force }); + if (!_base.update(_strSync) || force) + update({ _force: force }); } - if(!_isTextarea) { - _contentElement.find(imgElementSelector).each(function(i, el) { + if (!_isTextarea) { + _contentElement.find(imgElementSelector).each(function (i, el) { var index = COMPATIBILITY.inA(el, _imgs); if (index === -1) FRAMEWORK(el).off(imgElementLoadEvent, imgOnLoad).on(imgElementLoadEvent, imgOnLoad); @@ -4501,9 +4501,9 @@ * @returns {*} */ _base.options = function (newOptions, value) { - var option = { }; + var option = {}; var changedOps; - + //return current options if newOptions are undefined or empty if (FRAMEWORK.isEmptyObject(newOptions) || !FRAMEWORK.isPlainObject(newOptions)) { if (type(newOptions) == TYPES.s) { @@ -4520,19 +4520,19 @@ else { changedOps = setOptions(newOptions); } - - if(!FRAMEWORK.isEmptyObject(changedOps)) { - update({ _changedOptions : changedOps }); - } + + if (!FRAMEWORK.isEmptyObject(changedOps)) { + update({ _changedOptions: changedOps }); + } }; /** * Restore the DOM, disconnects all observers, remove all resize observers and put the instance to sleep. */ _base.destroy = function () { - if(_destroyed) + if (_destroyed) return; - + //remove this instance from auto update loop autoUpdateLoop.remove(_base); @@ -4544,11 +4544,11 @@ setupResizeObserver(_sizeAutoObserverElement); //remove all extensions - for(var extName in _extensions) + for (var extName in _extensions) _base.removeExt(extName); //remove all 'destroy' events - while(_destroyEvents[LEXICON.l] > 0) + while (_destroyEvents[LEXICON.l] > 0) _destroyEvents.pop()(); //remove all events from host element @@ -4568,7 +4568,7 @@ setupStructureDOM(true); //remove all generated image load events - for(var i = 0; i < _imgs[LEXICON.l]; i++) + for (var i = 0; i < _imgs[LEXICON.l]; i++) FRAMEWORK(_imgs[i]).off('load', imgOnLoad); _imgs = undefined; @@ -4669,45 +4669,45 @@ maxScrollX *= normalizeNegate ? -1 : 1; return { - position : { - x : scrollX, - y : infoY._currentScroll + position: { + x: scrollX, + y: infoY._currentScroll }, - ratio : { - x : scrollXRatio, - y : infoY._currentScrollRatio + ratio: { + x: scrollXRatio, + y: infoY._currentScrollRatio }, - max : { - x : maxScrollX, - y : infoY._maxScroll + max: { + x: maxScrollX, + y: infoY._maxScroll }, - handleOffset : { - x : infoX._handleOffset, - y : infoY._handleOffset + handleOffset: { + x: infoX._handleOffset, + y: infoY._handleOffset }, - handleLength : { - x : infoX._handleLength, - y : infoY._handleLength + handleLength: { + x: infoX._handleLength, + y: infoY._handleLength }, - handleLengthRatio : { - x : infoX._handleLengthRatio, - y : infoY._handleLengthRatio + handleLengthRatio: { + x: infoX._handleLengthRatio, + y: infoY._handleLengthRatio }, - trackLength : { - x : infoX._trackLength, - y : infoY._trackLength + trackLength: { + x: infoX._trackLength, + y: infoY._trackLength }, - snappedHandleOffset : { - x : infoX._snappedHandleOffset, - y : infoY._snappedHandleOffset + snappedHandleOffset: { + x: infoX._snappedHandleOffset, + y: infoY._snappedHandleOffset }, isRTL: _isRTL, isRTLNormalized: _normalizeRTLCache }; } - + _base.update(_strSync); - + var normalizeRTL = _normalizeRTLCache; var coordinatesXAxisProps = [_strX, _strLeft, 'l']; var coordinatesYAxisProps = [_strY, _strTop, 't']; @@ -4715,7 +4715,7 @@ var durationIsObject = type(duration) == TYPES.o; var completeCallback = durationIsObject ? duration.complete : complete; var i; - var finalScroll = { }; + var finalScroll = {}; var specialEasing = {}; var doScrollLeft; var doScrollTop; @@ -4740,11 +4740,14 @@ var possibleElement = coordinatesIsElementObj ? coordinates.el : coordinates; var possibleElementIsJQuery = possibleElement instanceof FRAMEWORK || JQUERY ? possibleElement instanceof JQUERY : false; var possibleElementIsHTMLElement = possibleElementIsJQuery ? false : isHTMLElement(possibleElement); - var proxyCompleteCallback = type(completeCallback) != TYPES.f ? undefined : function() { - if(doScrollLeft) + var updateScrollbarInfos = function () { + if (doScrollLeft) refreshScrollbarHandleOffset(true); - if(doScrollTop) + if (doScrollTop) refreshScrollbarHandleOffset(false); + }; + var proxyCompleteCallback = type(completeCallback) != TYPES.f ? undefined : function () { + updateScrollbarInfos(); completeCallback(); }; function checkSettingsStringValue(currValue, allowedValues) { @@ -4756,7 +4759,7 @@ } function getRawScroll(isX, coordinates) { var coordinateProps = isX ? coordinatesXAxisProps : coordinatesYAxisProps; - coordinates = type(coordinates) == TYPES.s || type(coordinates) == TYPES.n ? [ coordinates, coordinates ] : coordinates; + coordinates = type(coordinates) == TYPES.s || type(coordinates) == TYPES.n ? [coordinates, coordinates] : coordinates; if (type(coordinates) == TYPES.a) return isX ? coordinates[0] : coordinates[1]; @@ -4786,7 +4789,7 @@ //check operator if (rawScroll[strLength] > 2) { possibleOperator = rawScroll.substr(0, 2); - if(inArray(possibleOperator, coordinatesOperators) > -1) + if (inArray(possibleOperator, coordinatesOperators) > -1) operator = possibleOperator; } @@ -4837,7 +4840,7 @@ return finalValue === currScroll ? undefined : finalValue; } function getPerAxisValue(value, valueInternalType, defaultValue, allowedValues) { - var resultDefault = [ defaultValue, defaultValue ]; + var resultDefault = [defaultValue, defaultValue]; var valueType = type(value); var valueArrLength; var valueArrItem; @@ -4863,22 +4866,22 @@ } } else if (valueType == TYPES.o) - value = [ value[_strX]|| defaultValue, value[_strY] || defaultValue]; + value = [value[_strX] || defaultValue, value[_strY] || defaultValue]; else value = resultDefault; - return { x : value[0], y : value[1] }; + return { x: value[0], y: value[1] }; } function generateMargin(marginTopRightBottomLeftArray) { - var result = [ ]; + var result = []; var currValue; var currValueType; - var valueDirections = [ _strTop, _strRight, _strBottom, _strLeft ]; - for(i = 0; i < marginTopRightBottomLeftArray[strLength]; i++) { - if(i === valueDirections[strLength]) + var valueDirections = [_strTop, _strRight, _strBottom, _strLeft]; + for (i = 0; i < marginTopRightBottomLeftArray[strLength]; i++) { + if (i === valueDirections[strLength]) break; currValue = marginTopRightBottomLeftArray[i]; currValueType = type(currValue); - if(currValueType == TYPES.b) + if (currValueType == TYPES.b) result.push(currValue ? parseToZeroOrNumber(finalElement.css(_strMarginMinus + valueDirections[i])) : 0); else result.push(currValueType == TYPES.n ? currValue : 0); @@ -4892,20 +4895,20 @@ var axis = coordinatesIsElementObj ? coordinates.axis : 0; var scroll = coordinatesIsElementObj ? coordinates.scroll : 0; var block = coordinatesIsElementObj ? coordinates.block : 0; - var marginDefault = [ 0, 0, 0, 0 ]; + var marginDefault = [0, 0, 0, 0]; var marginType = type(margin); var marginLength; finalElement = possibleElementIsJQuery ? possibleElement : FRAMEWORK(possibleElement); - + if (finalElement[strLength] > 0) { //margin can be [ boolean, number, array of 2, array of 4, object ] if (marginType == TYPES.n || marginType == TYPES.b) margin = generateMargin([margin, margin, margin, margin]); else if (marginType == TYPES.a) { marginLength = margin[strLength]; - if(marginLength === 2) + if (marginLength === 2) margin = generateMargin([margin[0], margin[1], margin[0], margin[1]]); - else if(marginLength >= 4) + else if (marginLength >= 4) margin = generateMargin(margin); else margin = marginDefault; @@ -4931,8 +4934,8 @@ //get coordinates var elementOffset = finalElement.offset(); var doNotScroll = { - x : settingsScroll.x == strNever || settingsAxis == _strY, - y : settingsScroll.y == strNever || settingsAxis == _strX + x: settingsScroll.x == strNever || settingsAxis == _strY, + y: settingsScroll.y == strNever || settingsAxis == _strX }; elementOffset[_strTop] -= settingsMargin[0]; elementOffset[_strLeft] -= settingsMargin[3]; @@ -4953,14 +4956,14 @@ if (settingsBlock.x != strBegin || settingsBlock.y != strBegin || settingsScroll.x == strIfNeeded || settingsScroll.y == strIfNeeded || _isRTL) { var measuringElm = finalElement[0]; var rawElementSize = _supportTransform ? measuringElm[LEXICON.bCR]() : { - width : measuringElm[LEXICON.oW], - height : measuringElm[LEXICON.oH] + width: measuringElm[LEXICON.oW], + height: measuringElm[LEXICON.oH] }; var elementSize = { w: rawElementSize[_strWidth] + settingsMargin[3] + settingsMargin[1], h: rawElementSize[_strHeight] + settingsMargin[0] + settingsMargin[2] }; - var finalizeBlock = function(isX) { + var finalizeBlock = function (isX) { var vars = getScrollbarVars(isX); var wh = vars._w_h; var lt = vars._left_top; @@ -4982,9 +4985,9 @@ && elOffset >= vpOffset && elOffset + elSize <= vpOffset + vpSize; - if(scrollNever) + if (scrollNever) doNotScroll[xy] = true; - else if(!doNotScroll[xy]) { + else if (!doNotScroll[xy]) { if (blockIsNearest || scrollIfNeeded) { doNotScroll[xy] = scrollIfNeeded ? isInView : false; blockIsEnd = elSize < vpSize ? elementCenterOffset > viewportCenterOffset : elementCenterOffset < viewportCenterOffset; @@ -5036,6 +5039,7 @@ _viewportElement[_strScrollLeft](finalScroll[_strScrollLeft]); if (doScrollTop) _viewportElement[_strScrollTop](finalScroll[_strScrollTop]); + updateScrollbarInfos(); } }; @@ -5109,7 +5113,7 @@ contentScrollSize: prepare(_contentScrollSizeCache), viewportSize: prepare(_viewportSize), hostSize: prepare(_hostSizeCache), - documentMixed : prepare(_documentMixed) + documentMixed: prepare(_documentMixed) }; return type(stateProperty) == TYPES.s ? getObjectPropVal(obj, stateProperty) : obj; }; @@ -5119,21 +5123,21 @@ * @param extName The name of the extension from which the instance shall be got. * @returns {{}} The instance of the extension with the given name or undefined if the instance couldn't be found. */ - _base.ext = function(extName) { + _base.ext = function (extName) { var result; var privateMethods = _extensionsPrivateMethods.split(' '); var i = 0; - if(type(extName) == TYPES.s) { - if(_extensions[LEXICON.hOP](extName)) { + if (type(extName) == TYPES.s) { + if (_extensions[LEXICON.hOP](extName)) { result = extendDeep({}, _extensions[extName]); for (; i < privateMethods.length; i++) delete result[privateMethods[i]]; } } else { - result = { }; - for(i in _extensions) - result[i] = extendDeep({ }, _base.ext(i)); + result = {}; + for (i in _extensions) + result[i] = extendDeep({}, _base.ext(i)); } return result; }; @@ -5144,17 +5148,17 @@ * @param extensionOptions The extension options which shall be used. * @returns {{}} The instance of the added extension or undefined if the extension couldn't be added properly. */ - _base.addExt = function(extName, extensionOptions) { + _base.addExt = function (extName, extensionOptions) { var registeredExtensionObj = _plugin.extension(extName); var instance; var instanceAdded; var instanceContract; var contractResult; var contractFulfilled = true; - if(registeredExtensionObj) { - if(!_extensions[LEXICON.hOP](extName)) { + if (registeredExtensionObj) { + if (!_extensions[LEXICON.hOP](extName)) { instance = registeredExtensionObj.extensionFactory.call(_base, - extendDeep({ }, registeredExtensionObj.defaultOptions), + extendDeep({}, registeredExtensionObj.defaultOptions), FRAMEWORK, COMPATIBILITY); @@ -5164,10 +5168,10 @@ contractResult = instanceContract(window); contractFulfilled = type(contractResult) == TYPES.b ? contractResult : contractFulfilled; } - if(contractFulfilled) { + if (contractFulfilled) { _extensions[extName] = instance; instanceAdded = instance.added; - if(type(instanceAdded) == TYPES.f) + if (type(instanceAdded) == TYPES.f) instanceAdded(extensionOptions); return _base.ext(extName); @@ -5186,14 +5190,14 @@ * @param extName The name of the extension which shall be removed. * @returns {boolean} True if the extension was removed, false otherwise e.g. if the extension wasn't added before. */ - _base.removeExt = function(extName) { + _base.removeExt = function (extName) { var instance = _extensions[extName]; var instanceRemoved; - if(instance) { + if (instance) { delete _extensions[extName]; instanceRemoved = instance.removed; - if(type(instanceRemoved) == TYPES.f) + if (type(instanceRemoved) == TYPES.f) instanceRemoved(); return true; @@ -5217,7 +5221,7 @@ _rtlScrollBehavior = extendDeep({}, globals.rtlScrollBehavior); //parse & set options but don't update - setOptions(extendDeep({ }, _defaultOptions, options)); + setOptions(extendDeep({}, _defaultOptions, options)); _cssCalc = globals.cssCalc; _msieVersion = globals.msie; @@ -5233,7 +5237,7 @@ _windowElement = FRAMEWORK(_documentElementNative.defaultView || _documentElementNative.parentWindow); _windowElementNative = _windowElement[0]; _htmlElement = findFirst(_documentElement, 'html'); - _bodyElement = findFirst(_htmlElement, 'body'); + _bodyElement = findFirst(_htmlElement, 'body'); _targetElement = FRAMEWORK(targetElement); _targetElementNative = _targetElement[0]; _isTextarea = _targetElement.is('textarea'); @@ -5299,7 +5303,7 @@ *
* */ - _domExists = _isTextarea + _domExists = _isTextarea ? _targetElement.hasClass(_classNameTextareaElement) && _targetElement.parent().hasClass(_classNameContentElement) : _targetElement.hasClass(_classNameHostElement) && _targetElement.children(_strDot + _classNamePaddingElement)[LEXICON.l]; @@ -5309,15 +5313,15 @@ //check if the plugin hasn't to be initialized if (_nativeScrollbarIsOverlaid.x && _nativeScrollbarIsOverlaid.y && !_currentPreparedOptions.nativeScrollbarsOverlaid.initialize) { dispatchCallback('onInitializationWithdrawn'); - if(_domExists) { + if (_domExists) { setupStructureDOM(true); setupScrollbarsDOM(true); setupScrollbarCornerDOM(true); } - + _destroyed = true; _sleeping = true; - + return _base; } @@ -5325,8 +5329,8 @@ initBodyScroll = {}; initBodyScroll.l = MATH.max(_targetElement[_strScrollLeft](), _htmlElement[_strScrollLeft](), _windowElement[_strScrollLeft]()); initBodyScroll.t = MATH.max(_targetElement[_strScrollTop](), _htmlElement[_strScrollTop](), _windowElement[_strScrollTop]()); - - bodyMouseTouchDownListener = function() { + + bodyMouseTouchDownListener = function () { _viewportElement.removeAttr('tabindex'); setupResponsiveEventListener(_viewportElement, _strMouseTouchDownEvent, bodyMouseTouchDownListener, true, true); } @@ -5336,7 +5340,7 @@ setupStructureDOM(); setupScrollbarsDOM(); setupScrollbarCornerDOM(); - + //create OverlayScrollbars events setupStructureEvents(); setupScrollbarEvents(true); @@ -5349,16 +5353,16 @@ //build resize observer for the host element setupResizeObserver(_sizeObserverElement, hostOnResized); - if(_isBody) { + if (_isBody) { //apply the body scroll to handle it right in the update method _viewportElement[_strScrollLeft](initBodyScroll.l)[_strScrollTop](initBodyScroll.t); //set the focus on the viewport element so you dont have to click on the page to use keyboard keys (up / down / space) for scrolling - if(document.activeElement == targetElement && _viewportElementNative.focus) { + if (document.activeElement == targetElement && _viewportElementNative.focus) { //set a tabindex to make the viewportElement focusable _viewportElement.attr('tabindex', '-1'); _viewportElementNative.focus(); - + /* the tabindex has to be removed due to; * If you set the tabindex attribute on an
, then its child content cannot be scrolled with the arrow keys unless you set tabindex on the content, too * https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex @@ -5375,15 +5379,15 @@ dispatchCallback('onInitialized'); //call all callbacks which would fire before the initialized was complete - each(_callbacksInitQeueue, function(index, value) { dispatchCallback(value.n, value.a); }); - _callbacksInitQeueue = [ ]; + each(_callbacksInitQeueue, function (index, value) { dispatchCallback(value.n, value.a); }); + _callbacksInitQeueue = []; //add extensions - if(type(extensions) == TYPES.s) - extensions = [ extensions ]; - if(COMPATIBILITY.isA(extensions)) - each(extensions, function (index, value) {_base.addExt(value); }); - else if(FRAMEWORK.isPlainObject(extensions)) + if (type(extensions) == TYPES.s) + extensions = [extensions]; + if (COMPATIBILITY.isA(extensions)) + each(extensions, function (index, value) { _base.addExt(value); }); + else if (FRAMEWORK.isPlainObject(extensions)) each(extensions, function (key, value) { _base.addExt(key, value); }); //add the transition class for transitions AFTER the first update & AFTER the applied extensions (for preventing unwanted transitions) @@ -5395,10 +5399,10 @@ return _base; } - if(_plugin.valid(construct(pluginTargetElement, options, extensions))) { + if (_plugin.valid(construct(pluginTargetElement, options, extensions))) { INSTANCES(pluginTargetElement, _base); } - + return _base; } @@ -5409,17 +5413,17 @@ * @param extensions The extension(s) which shall be added right after initialization. * @returns {*} */ - _plugin = window[PLUGINNAME] = function(pluginTargetElements, options, extensions) { - if(arguments[LEXICON.l] === 0) + _plugin = window[PLUGINNAME] = function (pluginTargetElements, options, extensions) { + if (arguments[LEXICON.l] === 0) return this; - var arr = [ ]; + var arr = []; var optsIsPlainObj = FRAMEWORK.isPlainObject(options); var inst; var result; //pluginTargetElements is null or undefined - if(!pluginTargetElements) + if (!pluginTargetElements) return optsIsPlainObj || !options ? result : arr; /* @@ -5429,23 +5433,23 @@ 3. A Array with a single HTML Element so pluginTargetElements is always a array. */ - pluginTargetElements = pluginTargetElements[LEXICON.l] != undefined ? pluginTargetElements : [ pluginTargetElements[0] || pluginTargetElements ]; + pluginTargetElements = pluginTargetElements[LEXICON.l] != undefined ? pluginTargetElements : [pluginTargetElements[0] || pluginTargetElements]; initOverlayScrollbarsStatics(); - if(pluginTargetElements[LEXICON.l] > 0) { - if(optsIsPlainObj) { + if (pluginTargetElements[LEXICON.l] > 0) { + if (optsIsPlainObj) { FRAMEWORK.each(pluginTargetElements, function (i, v) { inst = v; - if(inst !== undefined) + if (inst !== undefined) arr.push(OverlayScrollbarsInstance(inst, options, extensions, _pluginsGlobals, _pluginsAutoUpdateLoop)); }); } else { - FRAMEWORK.each(pluginTargetElements, function(i, v) { + FRAMEWORK.each(pluginTargetElements, function (i, v) { inst = INSTANCES(v); - if((options === '!' && _plugin.valid(inst)) || (COMPATIBILITY.type(options) == TYPES.f && options(v, inst))) + if ((options === '!' && _plugin.valid(inst)) || (COMPATIBILITY.type(options) == TYPES.f && options(v, inst))) arr.push(inst); - else if(options === undefined) + else if (options === undefined) arr.push(inst); }); } @@ -5460,7 +5464,7 @@ */ _plugin.globals = function () { initOverlayScrollbarsStatics(); - var globals = FRAMEWORK.extend(true, { }, _pluginsGlobals); + var globals = FRAMEWORK.extend(true, {}, _pluginsGlobals); delete globals['msie']; return globals; }; @@ -5469,14 +5473,14 @@ * Gets or Sets the default options for each new plugin initialization. * @param newDefaultOptions The object with which the default options shall be extended. */ - _plugin.defaultOptions = function(newDefaultOptions) { + _plugin.defaultOptions = function (newDefaultOptions) { initOverlayScrollbarsStatics(); var currDefaultOptions = _pluginsGlobals.defaultOptions; - if(newDefaultOptions === undefined) - return FRAMEWORK.extend(true, { }, currDefaultOptions); + if (newDefaultOptions === undefined) + return FRAMEWORK.extend(true, {}, currDefaultOptions); //set the new default options - _pluginsGlobals.defaultOptions = FRAMEWORK.extend(true, { }, currDefaultOptions , _pluginsOptions._validate(newDefaultOptions, _pluginsOptions._template, true, currDefaultOptions)._default); + _pluginsGlobals.defaultOptions = FRAMEWORK.extend(true, {}, currDefaultOptions, _pluginsOptions._validate(newDefaultOptions, _pluginsOptions._template, true, currDefaultOptions)._default); }; /** @@ -5498,30 +5502,30 @@ * @param extension A function which generates the instance of the extension or anything other to remove a already registered extension. * @param defaultOptions The default options which shall be used for the registered extension. */ - _plugin.extension = function(extensionName, extension, defaultOptions) { + _plugin.extension = function (extensionName, extension, defaultOptions) { var extNameTypeString = COMPATIBILITY.type(extensionName) == TYPES.s; var argLen = arguments[LEXICON.l]; var i = 0; - if(argLen < 1 || !extNameTypeString) { + if (argLen < 1 || !extNameTypeString) { //return a copy of all extension objects - return FRAMEWORK.extend(true, { length : _pluginsExtensions[LEXICON.l] }, _pluginsExtensions); + return FRAMEWORK.extend(true, { length: _pluginsExtensions[LEXICON.l] }, _pluginsExtensions); } - else if(extNameTypeString) { - if(COMPATIBILITY.type(extension) == TYPES.f) { + else if (extNameTypeString) { + if (COMPATIBILITY.type(extension) == TYPES.f) { //register extension _pluginsExtensions.push({ - name : extensionName, - extensionFactory : extension, - defaultOptions : defaultOptions + name: extensionName, + extensionFactory: extension, + defaultOptions: defaultOptions }); } else { - for(; i < _pluginsExtensions[LEXICON.l]; i++) { + for (; i < _pluginsExtensions[LEXICON.l]; i++) { if (_pluginsExtensions[i].name === extensionName) { - if(argLen > 1) + if (argLen > 1) _pluginsExtensions.splice(i, 1); //remove extension else - return FRAMEWORK.extend(true, { }, _pluginsExtensions[i]); //return extension with the given name + return FRAMEWORK.extend(true, {}, _pluginsExtensions[i]); //return extension with the given name } } } @@ -5531,7 +5535,7 @@ return _plugin; })(); - if(JQUERY && JQUERY.fn) { + if (JQUERY && JQUERY.fn) { /** * The jQuery initialization interface. * @param options The initial options for the construction of the plugin. To initialize the plugin, this option has to be a object! If it isn't a object, the instance(s) are returned and the plugin wont be initialized. @@ -5540,8 +5544,8 @@ */ JQUERY.fn.overlayScrollbars = function (options, extensions) { var _elements = this; - if(JQUERY.isPlainObject(options)) { - JQUERY.each(_elements, function() { PLUGIN(this, options, extensions); }); + if (JQUERY.isPlainObject(options)) { + JQUERY.each(_elements, function () { PLUGIN(this, options, extensions); }); return _elements; } else diff --git a/js/jquery.overlayScrollbars.min.js b/js/jquery.overlayScrollbars.min.js index caae09d1..53acb3ef 100644 --- a/js/jquery.overlayScrollbars.min.js +++ b/js/jquery.overlayScrollbars.min.js @@ -2,12 +2,12 @@ * OverlayScrollbars * https://github.com/KingSora/OverlayScrollbars * - * Version: 1.10.2 + * Version: 1.10.3 * * Copyright KingSora | Rene Haas. * https://github.com/KingSora * * Released under the MIT license. - * Date: 30.12.2019 + * Date: 02.02.2020 */ -!function(t,r){"function"==typeof define&&define.amd?define(["jquery"],function(n){return r(t,t.document,undefined,n)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=r(t,t.document,undefined,require("jquery")):r(t,t.document,undefined,t.jQuery)}("undefined"!=typeof window?window:this,function(bt,gt,wi,n){"use strict";var o,f,c,a,mt="object",yt="function",wt="array",xt="string",_t="boolean",St="number",t="null",zt="class",xi="style",Tt="id",_i="length",kt="prototype",Si="offsetHeight",zi="clientHeight",Ti="scrollHeight",ki="offsetWidth",Oi="clientWidth",Ci="scrollWidth",Ot="hasOwnProperty",Ai="getBoundingClientRect",Ct=(o={},f={},{e:c=["-webkit-","-moz-","-o-","-ms-"],o:a=["WebKit","Moz","O","MS"],u:function(n){var t=f[n];if(f[Ot](n))return t;for(var r,e,i,o=l(n),a=gt.createElement("div")[xi],u=0;u
'),o=z[0],e=Ii(z.children("div").eq(0));S.append(z),z.hide().show();var t,r,a,u,f,c,l,s,v,d=T(o),h={x:0===d.x,y:0===d.y},p=(r=bt.navigator.userAgent,u="substring",f=r[a="indexOf"]("MSIE "),c=r[a]("Trident/"),l=r[a]("Edge/"),s=r[a]("rv:"),v=parseInt,0i&&(t.update("auto"),h[f]=new Date(o+=i)),n=Ri.max(1,Ri.min(n,i)));b=n}}else b=33};this.add=function(n){-1===e(n,d)&&(d.push(n),h.push(l()),0/g,(s?"-":Ce)+Ne)[v](/px/g,Ce)[v](/%/g," * "+c*(l&&Dt.n?-1:1)/100)[v](/vw/g," * "+he.w)[v](/vh/g," * "+he.h),di(isNaN(t)?di(d(t),!0).toFixed():t)):t)!==wi&&!isNaN(e)&&ln(e)==St){var h=w&&l,p=f*(h&&Dt.n?-1:1),b=h&&Dt.i,g=h&&Dt.n;switch(p=b?c-p:p,r){case"+=":i=p+e;break;case"-=":i=p-e;break;case"*=":i=p*e;break;case"/=":i=p/e;break;default:i=e}i=b?c-i:i,i*=g?-1:1,i=l&&Dt.n?Ri.min(0,Ri.max(c,i)):Ri.max(0,Ri.min(c,i))}return i===f?wi:i}function B(n,t,r,e){var i,o,a=[r,r],u=ln(n);if(u==t)n=[n,n];else if(u==wt){if(2<(i=n[L])||i<1)n=a;else for(1===i&&(n[1]=r),s=0;s=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom||Jn(),(ae||ue)&&ai(!1)}}function R(n){i=fr[C](),i=isNaN(i)?0:i,(Qt&&_&&!Dt.n||!Qt)&&(i=i<0?0:i),T=ft()[O],z=f(n),F=!c(a),mi(E,Wn),mi(r.rn,o),mi(r.nn,o),Xn(W,[Y,X,Q],[d,L,Zn]),!I&&y||Hi.prvD(n),Hi.stpP(n)}Yn(r.rn,V,function h(n){N(n)&&R(n)}),Yn(r.tn,[V,$,K],[function D(n){if(N(n)){var d,h=Ri.round(he[r.M]),p=r.tn.offset()[r.W],t=n.ctrlKey,b=n.shiftKey,g=b&&t,m=!0,y=function(n){F&&fi(_,n)},w=function(){y(),R(n)},x=function(){if(!Pt){var n=(z-p)*T,t=k.N,r=k.D,e=k.L,i=k.H,o=k.C,a=270*A,u=m?Ri.max(400,a):a,f=i*((n-e/2)/(r-e)),c=Qt&&_&&(!Dt.i&&!Dt.n||Xr),l=c?t"+(n||Ce)+""}function st(n,t){var r=ln(t)==_t,e=r?ir:t||ir;return v&&!e[_i]?null:v?e[r?"children":"find"](P+n.replace(/\s/g,P)).eq(0):Ii(pi(n))}function vt(n,t){for(var r,e=t.split(P),i=0;i
'),o=z[0],e=Ii(z.children("div").eq(0));S.append(z),z.hide().show();var t,r,a,u,f,c,l,s,v,d=T(o),h={x:0===d.x,y:0===d.y},p=(r=bt.navigator.userAgent,u="substring",f=r[a="indexOf"]("MSIE "),c=r[a]("Trident/"),l=r[a]("Edge/"),s=r[a]("rv:"),v=parseInt,0i&&(t.update("auto"),h[f]=new Date(o+=i)),n=Ri.max(1,Ri.min(n,i)));b=n}}else b=33};this.add=function(n){-1===e(n,d)&&(d.push(n),h.push(l()),0/g,(s?"-":Ce)+Ne)[v](/px/g,Ce)[v](/%/g," * "+c*(l&&Dt.n?-1:1)/100)[v](/vw/g," * "+he.w)[v](/vh/g," * "+he.h),di(isNaN(t)?di(d(t),!0).toFixed():t)):t)!==wi&&!isNaN(e)&&sn(e)==St){var h=x&&l,p=f*(h&&Dt.n?-1:1),b=h&&Dt.i,g=h&&Dt.n;switch(p=b?c-p:p,r){case"+=":i=p+e;break;case"-=":i=p-e;break;case"*=":i=p*e;break;case"/=":i=p/e;break;default:i=e}i=b?c-i:i,i*=g?-1:1,i=l&&Dt.n?Ri.min(0,Ri.max(c,i)):Ri.max(0,Ri.min(c,i))}return i===f?wi:i}function V(n,t,r,e){var i,o,a=[r,r],u=sn(n);if(u==t)n=[n,n];else if(u==wt){if(2<(i=n[R])||i<1)n=a;else for(1===i&&(n[1]=r),v=0;v=t.left&&n.clientX<=t.right&&n.clientY>=t.top&&n.clientY<=t.bottom||Jn(),(ae||ue)&&ai(!1)}}function R(n){i=fr[C](),i=isNaN(i)?0:i,(Qt&&_&&!Dt.n||!Qt)&&(i=i<0?0:i),T=ft()[O],z=f(n),F=!c(a),mi(E,Wn),mi(r.rn,o),mi(r.nn,o),Xn(W,[Y,X,Q],[d,L,Zn]),!I&&y||Hi.prvD(n),Hi.stpP(n)}Yn(r.rn,V,function h(n){N(n)&&R(n)}),Yn(r.tn,[V,$,K],[function D(n){if(N(n)){var d,h=Ri.round(he[r.M]),p=r.tn.offset()[r.W],t=n.ctrlKey,b=n.shiftKey,g=b&&t,m=!0,y=function(n){F&&fi(_,n)},w=function(){y(),R(n)},x=function(){if(!Pt){var n=(z-p)*T,t=k.N,r=k.D,e=k.L,i=k.H,o=k.C,a=270*A,u=m?Ri.max(400,a):a,f=i*((n-e/2)/(r-e)),c=Qt&&_&&(!Dt.i&&!Dt.n||Xr),l=c?t"+(n||Ce)+""}function st(n,t){var r=sn(t)==_t,e=r?ir:t||ir;return v&&!e[_i]?null:v?e[r?"children":"find"](P+n.replace(/\s/g,P)).eq(0):Ii(pi(n))}function vt(n,t){for(var r,e=t.split(P),i=0;i