version 1.4.3

This commit is contained in:
Rene
2018-04-17 21:53:09 +02:00
parent 9ae65fde91
commit 47442f91b2
8 changed files with 57 additions and 57 deletions
+2 -2
View File
@@ -58,7 +58,7 @@ Include **OverlayScrollbars.css** and **OverlayScrollbars.js** to your HTML file
<script type="text/javascript" src="path/to/OverlayScrollbars.js"></script> <script type="text/javascript" src="path/to/OverlayScrollbars.js"></script>
``` ```
If you are using the jQuery version include [jQuery](https://jquery.com/) before the plugin and use **jquery.overlayScrollbars.js** If you are using the jQuery version, include [jQuery](https://jquery.com/) before the plugin and use **jquery.overlayScrollbars.js**
```html ```html
<!-- Plugin CSS --> <!-- Plugin CSS -->
@@ -82,7 +82,7 @@ $(function() {
}); });
``` ```
jQuery initialization (will only work with the jQuery version): jQuery initialization:
```js ```js
$(function() { $(function() {
//The passed argument has to be at least a empty object or a object with your desired options //The passed argument has to be at least a empty object or a object with your desired options
+2 -2
View File
@@ -2,13 +2,13 @@
* OverlayScrollbars * OverlayScrollbars
* https://github.com/KingSora/OverlayScrollbars * https://github.com/KingSora/OverlayScrollbars
* *
* Version: 1.4.2 * Version: 1.4.3
* *
* Copyright KingSora. * Copyright KingSora.
* https://github.com/KingSora * https://github.com/KingSora
* *
* Released under the MIT license. * Released under the MIT license.
* Date: 14.04.2018 * Date: 17.04.2018
*/ */
/* /*
+2 -2
View File
File diff suppressed because one or more lines are too long
+22 -22
View File
@@ -2,13 +2,13 @@
* OverlayScrollbars * OverlayScrollbars
* https://github.com/KingSora/OverlayScrollbars * https://github.com/KingSora/OverlayScrollbars
* *
* Version: 1.4.2 * Version: 1.4.3
* *
* Copyright KingSora. * Copyright KingSora.
* https://github.com/KingSora * https://github.com/KingSora
* *
* Released under the MIT license. * Released under the MIT license.
* Date: 14.04.2018 * Date: 17.04.2018
*/ */
(function (global, factory) { (function (global, factory) {
@@ -206,6 +206,7 @@
} }
}; };
var JQUERY = window.jQuery;
var FRAMEWORK = (function(compatibility) { var FRAMEWORK = (function(compatibility) {
var _rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); var _rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g );
var _toStr = Object.prototype.toString; var _toStr = Object.prototype.toString;
@@ -3808,6 +3809,20 @@
var hideScrollbarH = compatibility.bind(refreshScrollbarAppearance, 0, true, false, canScroll.x); var hideScrollbarH = compatibility.bind(refreshScrollbarAppearance, 0, true, false, canScroll.x);
var hideScrollbarV = compatibility.bind(refreshScrollbarAppearance, 0, false, false, canScroll.y); var hideScrollbarV = compatibility.bind(refreshScrollbarAppearance, 0, false, false, canScroll.y);
//manage class name which indicates scrollable overflow
if (hideOverflow.x || hideOverflow.y)
addClass(_hostElement, _classNameHostOverflow);
else
removeClass(_hostElement, _classNameHostOverflow);
if (hideOverflow.x)
addClass(_hostElement, _classNameHostOverflowX);
else
removeClass(_hostElement, _classNameHostOverflowX);
if (hideOverflow.y)
addClass(_hostElement, _classNameHostOverflowY);
else
removeClass(_hostElement, _classNameHostOverflowY);
//add or remove rtl class name for styling purposes //add or remove rtl class name for styling purposes
if (cssDirectionChanged) { if (cssDirectionChanged) {
if (_isRTL) if (_isRTL)
@@ -3942,20 +3957,6 @@
if (scrollbarsDragScrollingChanged) if (scrollbarsDragScrollingChanged)
refreshScrollbarsInteractive(false, scrollbarsDragScrolling); refreshScrollbarsInteractive(false, scrollbarsDragScrolling);
//manage class name which indicates scrollable overflow
if (hideOverflow.x || hideOverflow.y)
addClass(_hostElement, _classNameHostOverflow);
else
removeClass(_hostElement, _classNameHostOverflow);
if (hideOverflow.x)
addClass(_hostElement, _classNameHostOverflowX);
else
removeClass(_hostElement, _classNameHostOverflowX);
if (hideOverflow.y)
addClass(_hostElement, _classNameHostOverflowY);
else
removeClass(_hostElement, _classNameHostOverflowY);
//handle scroll //handle scroll
if (_isTextarea && contentSizeChanged) { if (_isTextarea && contentSizeChanged) {
var textareaInfo = getTextareaInfo(); var textareaInfo = getTextareaInfo();
@@ -5099,7 +5100,7 @@
var elementObjSettingsBlockValues = [strBegin, strEnd, strCenter, strNearest]; var elementObjSettingsBlockValues = [strBegin, strEnd, strCenter, strNearest];
var coordinatesIsElementObj = coordinates.hasOwnProperty('el'); var coordinatesIsElementObj = coordinates.hasOwnProperty('el');
var possibleElement = coordinatesIsElementObj ? coordinates.el : coordinates; var possibleElement = coordinatesIsElementObj ? coordinates.el : coordinates;
var possibleElementIsJQuery = possibleElement instanceof helper || possibleElement instanceof window.jQuery; var possibleElementIsJQuery = possibleElement instanceof helper || JQUERY ? possibleElement instanceof JQUERY : false;
var possibleElementIsHTMLElement = possibleElementIsJQuery ? false : isHTMLElement(possibleElement); var possibleElementIsHTMLElement = possibleElementIsJQuery ? false : isHTMLElement(possibleElement);
var checkSettingsStringValue = function (currValue, allowedValues) { var checkSettingsStringValue = function (currValue, allowedValues) {
for (i = 0; i < allowedValues.length; i++) { for (i = 0; i < allowedValues.length; i++) {
@@ -5796,17 +5797,16 @@
return window[PLUGINNAME]; return window[PLUGINNAME];
})(COMPATIBILITY, INSTANCES, FRAMEWORK); })(COMPATIBILITY, INSTANCES, FRAMEWORK);
var jQuery = window.jQuery; if(JQUERY && JQUERY.fn) {
if(jQuery && jQuery.fn) {
/** /**
* The jQuery initialization interface. * 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. * @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.
* @returns {*} After initialization it returns the jQuery element array, else it returns the instance(s) of the elements which are selected. * @returns {*} After initialization it returns the jQuery element array, else it returns the instance(s) of the elements which are selected.
*/ */
jQuery.fn.overlayScrollbars = function (options) { JQUERY.fn.overlayScrollbars = function (options) {
var _elements = this; var _elements = this;
if(jQuery.isPlainObject(options)) { if(JQUERY.isPlainObject(options)) {
jQuery.each(_elements, function() { PLUGIN(this, options); }); JQUERY.each(_elements, function() { PLUGIN(this, options); });
return _elements; return _elements;
} }
else else
+3 -3
View File
File diff suppressed because one or more lines are too long
+22 -22
View File
@@ -2,13 +2,13 @@
* OverlayScrollbars * OverlayScrollbars
* https://github.com/KingSora/OverlayScrollbars * https://github.com/KingSora/OverlayScrollbars
* *
* Version: 1.4.2 * Version: 1.4.3
* *
* Copyright KingSora. * Copyright KingSora.
* https://github.com/KingSora * https://github.com/KingSora
* *
* Released under the MIT license. * Released under the MIT license.
* Date: 14.04.2018 * Date: 17.04.2018
*/ */
(function (global, factory) { (function (global, factory) {
@@ -206,6 +206,7 @@
} }
}; };
var JQUERY = framework;
var FRAMEWORK = framework; var FRAMEWORK = framework;
var INSTANCES = (function(helper) { var INSTANCES = (function(helper) {
var _targets = [ ]; var _targets = [ ];
@@ -2800,6 +2801,20 @@
var hideScrollbarH = compatibility.bind(refreshScrollbarAppearance, 0, true, false, canScroll.x); var hideScrollbarH = compatibility.bind(refreshScrollbarAppearance, 0, true, false, canScroll.x);
var hideScrollbarV = compatibility.bind(refreshScrollbarAppearance, 0, false, false, canScroll.y); var hideScrollbarV = compatibility.bind(refreshScrollbarAppearance, 0, false, false, canScroll.y);
//manage class name which indicates scrollable overflow
if (hideOverflow.x || hideOverflow.y)
addClass(_hostElement, _classNameHostOverflow);
else
removeClass(_hostElement, _classNameHostOverflow);
if (hideOverflow.x)
addClass(_hostElement, _classNameHostOverflowX);
else
removeClass(_hostElement, _classNameHostOverflowX);
if (hideOverflow.y)
addClass(_hostElement, _classNameHostOverflowY);
else
removeClass(_hostElement, _classNameHostOverflowY);
//add or remove rtl class name for styling purposes //add or remove rtl class name for styling purposes
if (cssDirectionChanged) { if (cssDirectionChanged) {
if (_isRTL) if (_isRTL)
@@ -2934,20 +2949,6 @@
if (scrollbarsDragScrollingChanged) if (scrollbarsDragScrollingChanged)
refreshScrollbarsInteractive(false, scrollbarsDragScrolling); refreshScrollbarsInteractive(false, scrollbarsDragScrolling);
//manage class name which indicates scrollable overflow
if (hideOverflow.x || hideOverflow.y)
addClass(_hostElement, _classNameHostOverflow);
else
removeClass(_hostElement, _classNameHostOverflow);
if (hideOverflow.x)
addClass(_hostElement, _classNameHostOverflowX);
else
removeClass(_hostElement, _classNameHostOverflowX);
if (hideOverflow.y)
addClass(_hostElement, _classNameHostOverflowY);
else
removeClass(_hostElement, _classNameHostOverflowY);
//handle scroll //handle scroll
if (_isTextarea && contentSizeChanged) { if (_isTextarea && contentSizeChanged) {
var textareaInfo = getTextareaInfo(); var textareaInfo = getTextareaInfo();
@@ -4091,7 +4092,7 @@
var elementObjSettingsBlockValues = [strBegin, strEnd, strCenter, strNearest]; var elementObjSettingsBlockValues = [strBegin, strEnd, strCenter, strNearest];
var coordinatesIsElementObj = coordinates.hasOwnProperty('el'); var coordinatesIsElementObj = coordinates.hasOwnProperty('el');
var possibleElement = coordinatesIsElementObj ? coordinates.el : coordinates; var possibleElement = coordinatesIsElementObj ? coordinates.el : coordinates;
var possibleElementIsJQuery = possibleElement instanceof helper || possibleElement instanceof window.jQuery; var possibleElementIsJQuery = possibleElement instanceof helper || JQUERY ? possibleElement instanceof JQUERY : false;
var possibleElementIsHTMLElement = possibleElementIsJQuery ? false : isHTMLElement(possibleElement); var possibleElementIsHTMLElement = possibleElementIsJQuery ? false : isHTMLElement(possibleElement);
var checkSettingsStringValue = function (currValue, allowedValues) { var checkSettingsStringValue = function (currValue, allowedValues) {
for (i = 0; i < allowedValues.length; i++) { for (i = 0; i < allowedValues.length; i++) {
@@ -4788,17 +4789,16 @@
return window[PLUGINNAME]; return window[PLUGINNAME];
})(COMPATIBILITY, INSTANCES, FRAMEWORK); })(COMPATIBILITY, INSTANCES, FRAMEWORK);
var jQuery = window.jQuery; if(JQUERY && JQUERY.fn) {
if(jQuery && jQuery.fn) {
/** /**
* The jQuery initialization interface. * 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. * @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.
* @returns {*} After initialization it returns the jQuery element array, else it returns the instance(s) of the elements which are selected. * @returns {*} After initialization it returns the jQuery element array, else it returns the instance(s) of the elements which are selected.
*/ */
jQuery.fn.overlayScrollbars = function (options) { JQUERY.fn.overlayScrollbars = function (options) {
var _elements = this; var _elements = this;
if(jQuery.isPlainObject(options)) { if(JQUERY.isPlainObject(options)) {
jQuery.each(_elements, function() { PLUGIN(this, options); }); JQUERY.each(_elements, function() { PLUGIN(this, options); });
return _elements; return _elements;
} }
else else
+3 -3
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "overlayscrollbars", "name": "overlayscrollbars",
"version": "1.4.2", "version": "1.4.3",
"description": "A javascript scrollbar plugin which hides the native scrollbars and provides custom styleable overlay scrollbars, but keeps the native functionality and feeling.", "description": "A javascript scrollbar plugin which hides the native scrollbars and provides custom styleable overlay scrollbars, but keeps the native functionality and feeling.",
"keywords" : [ "keywords" : [
"overlayscrollbars", "overlayscrollbars",