Skip to content

Commit

Permalink
Dev: Update bootstrap-slider to latet Version
Browse files Browse the repository at this point in the history
  • Loading branch information
markusfluer committed Aug 9, 2016
1 parent 6e8e68c commit 627a3a4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 35 deletions.
27 changes: 19 additions & 8 deletions third_party/bootstrap-slider/bootstrap-slider.js
@@ -1,5 +1,5 @@
/*! =======================================================
VERSION 9.1.1
VERSION 9.1.3
========================================================= */
"use strict";

Expand Down Expand Up @@ -36,6 +36,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
* v1.0.1
* MIT license
*/
var windowIsDefined = (typeof window === "undefined" ? "undefined" : _typeof(window)) === "object";

(function (factory) {
if (typeof define === "function" && define.amd) {
Expand All @@ -57,13 +58,13 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
var NAMESPACE_ALTERNATE = 'bootstrapSlider';

// Polyfill console methods
if (!window.console) {
if (windowIsDefined && !window.console) {
window.console = {};
}
if (!window.console.log) {
if (windowIsDefined && !window.console.log) {
window.console.log = function () {};
}
if (!window.console.warn) {
if (windowIsDefined && !window.console.warn) {
window.console.warn = function () {};
}

Expand Down Expand Up @@ -761,7 +762,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
},

getValue: function getValue() {
if (this.options.range) {
if (this.options.range || this._state.value === null) {
return this._state.value;
} else {
return this._state.value[0];
Expand Down Expand Up @@ -1294,7 +1295,10 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
dir = -dir;
}
}

if (this._state.value === null) {
this._state.value[0] = this._state.min;
this._state.value[1] = this._state.max;
}
var val = this._state.value[handleIdx] + dir * this.options.step;
if (this.options.range) {
val = [!handleIdx ? val : this._state.value[0], handleIdx ? val : this._state.value[1]];
Expand Down Expand Up @@ -1442,6 +1446,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
return Math.max(0, (match[1] ? match[1].length : 0) - (match[2] ? +match[2] : 0));
},
_applyToFixedAndParseFloat: function _applyToFixedAndParseFloat(num, toFixedInput) {
if (num === null) {
return null;
}
var truncatedNum = num.toFixed(toFixedInput);
return parseFloat(truncatedNum);
},
Expand Down Expand Up @@ -1475,14 +1482,16 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
} else if (Array.isArray(val)) {
this._validateArray(val);
return val;
} else if (val === null) {
return null;
} else {
throw new Error(ErrorMsgs.formatInvalidInputErrorMsg(val));
}
},
_validateArray: function _validateArray(val) {
for (var i = 0; i < val.length; i++) {
var input = val[i];
if (typeof input !== 'number') {
if (typeof input !== 'number' && input !== null) {
throw new Error(ErrorMsgs.formatInvalidInputErrorMsg(input));
}
}
Expand Down Expand Up @@ -1624,7 +1633,9 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
$.bridget(NAMESPACE_MAIN, Slider);
autoRegisterNamespace = NAMESPACE_MAIN;
} else {
window.console.warn("bootstrap-slider.js - WARNING: $.fn.slider namespace is already bound. Use the $.fn.bootstrapSlider namespace instead.");
if (windowIsDefined) {
//window.console.warn("bootstrap-slider.js - WARNING: $.fn.slider namespace is already bound. Use the $.fn.bootstrapSlider namespace instead.");
}
autoRegisterNamespace = NAMESPACE_ALTERNATE;
}
$.bridget(NAMESPACE_ALTERNATE, Slider);
Expand Down

0 comments on commit 627a3a4

Please sign in to comment.