bootstrap-slider-rails 9.7.0 → 9.8.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de07875d169d068b9ae5663bc3480b783a7b0f05
|
4
|
+
data.tar.gz: 8e9ccb27822b1d218354f59df3cdc1d039ba21fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 496116b305bc13d8488958a33da9fbcb8e5a20027aba690d471be8cd1d5333431ba48cdedf69150d029a2efff53d4512b7c47612b1e2e8a329ee717f5e806f44
|
7
|
+
data.tar.gz: 9f23e5316abb908da020d3d53d8425d65feba8c3cc1acb1b9a42ecf93066405840bc659471484fde4938160e2681d525998e28cbdd460fd41df37e425ac55b9c
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*! =======================================================
|
2
|
-
VERSION 9.
|
2
|
+
VERSION 9.8.0
|
3
3
|
========================================================= */
|
4
4
|
"use strict";
|
5
5
|
|
@@ -460,12 +460,12 @@ var windowIsDefined = (typeof window === "undefined" ? "undefined" : _typeof(win
|
|
460
460
|
|
461
461
|
/* Create highlight range elements */
|
462
462
|
this.rangeHighlightElements = [];
|
463
|
-
|
464
|
-
|
465
|
-
|
463
|
+
var rangeHighlightsOpts = this.options.rangeHighlights;
|
464
|
+
if (Array.isArray(rangeHighlightsOpts) && rangeHighlightsOpts.length > 0) {
|
465
|
+
for (var j = 0; j < rangeHighlightsOpts.length; j++) {
|
466
466
|
var rangeHighlightElement = document.createElement("div");
|
467
|
-
|
468
|
-
|
467
|
+
var customClassString = rangeHighlightsOpts[j].class || "";
|
468
|
+
rangeHighlightElement.className = "slider-rangeHighlight slider-selection " + customClassString;
|
469
469
|
this.rangeHighlightElements.push(rangeHighlightElement);
|
470
470
|
sliderTrack.appendChild(rangeHighlightElement);
|
471
471
|
}
|
@@ -1527,8 +1527,13 @@ var windowIsDefined = (typeof window === "undefined" ? "undefined" : _typeof(win
|
|
1527
1527
|
}
|
1528
1528
|
|
1529
1529
|
var val = this._state.value[handleIdx] + dir * this.options.step;
|
1530
|
+
var percentage = val / this.options.max * 100;
|
1531
|
+
this._state.keyCtrl = handleIdx;
|
1530
1532
|
if (this.options.range) {
|
1531
|
-
|
1533
|
+
this._adjustPercentageForRangeSliders(percentage);
|
1534
|
+
var val1 = !this._state.keyCtrl ? val : this._state.value[0];
|
1535
|
+
var val2 = this._state.keyCtrl ? val : this._state.value[1];
|
1536
|
+
val = [val1, val2];
|
1532
1537
|
}
|
1533
1538
|
|
1534
1539
|
this._trigger('slideStart', val);
|
@@ -1540,6 +1545,7 @@ var windowIsDefined = (typeof window === "undefined" ? "undefined" : _typeof(win
|
|
1540
1545
|
this._layout();
|
1541
1546
|
|
1542
1547
|
this._pauseEvent(ev);
|
1548
|
+
delete this._state.keyCtrl;
|
1543
1549
|
|
1544
1550
|
return false;
|
1545
1551
|
},
|
@@ -1600,6 +1606,14 @@ var windowIsDefined = (typeof window === "undefined" ? "undefined" : _typeof(win
|
|
1600
1606
|
} else if (this._state.dragged === 1 && this._applyToFixedAndParseFloat(this._state.percentage[0], precision) > percentageWithAdjustedPrecision) {
|
1601
1607
|
this._state.percentage[1] = this._state.percentage[0];
|
1602
1608
|
this._state.dragged = 0;
|
1609
|
+
} else if (this._state.keyCtrl === 0 && this._state.value[1] / this.options.max * 100 < percentage) {
|
1610
|
+
this._state.percentage[0] = this._state.percentage[1];
|
1611
|
+
this._state.keyCtrl = 1;
|
1612
|
+
this.handle2.focus();
|
1613
|
+
} else if (this._state.keyCtrl === 1 && this._state.value[0] / this.options.max * 100 > percentage) {
|
1614
|
+
this._state.percentage[1] = this._state.percentage[0];
|
1615
|
+
this._state.keyCtrl = 0;
|
1616
|
+
this.handle1.focus();
|
1603
1617
|
}
|
1604
1618
|
}
|
1605
1619
|
},
|
@@ -1863,26 +1877,24 @@ var windowIsDefined = (typeof window === "undefined" ? "undefined" : _typeof(win
|
|
1863
1877
|
/*********************************
|
1864
1878
|
Attach to global namespace
|
1865
1879
|
*********************************/
|
1866
|
-
if ($) {
|
1867
|
-
|
1868
|
-
var autoRegisterNamespace = void 0;
|
1880
|
+
if ($ && $.fn) {
|
1881
|
+
var autoRegisterNamespace = void 0;
|
1869
1882
|
|
1870
|
-
|
1871
|
-
|
1872
|
-
|
1873
|
-
|
1874
|
-
|
1875
|
-
|
1876
|
-
}
|
1877
|
-
autoRegisterNamespace = NAMESPACE_ALTERNATE;
|
1883
|
+
if (!$.fn.slider) {
|
1884
|
+
$.bridget(NAMESPACE_MAIN, Slider);
|
1885
|
+
autoRegisterNamespace = NAMESPACE_MAIN;
|
1886
|
+
} else {
|
1887
|
+
if (windowIsDefined) {
|
1888
|
+
window.console.warn("bootstrap-slider.js - WARNING: $.fn.slider namespace is already bound. Use the $.fn.bootstrapSlider namespace instead.");
|
1878
1889
|
}
|
1879
|
-
|
1890
|
+
autoRegisterNamespace = NAMESPACE_ALTERNATE;
|
1891
|
+
}
|
1892
|
+
$.bridget(NAMESPACE_ALTERNATE, Slider);
|
1880
1893
|
|
1881
|
-
|
1882
|
-
|
1883
|
-
|
1884
|
-
|
1885
|
-
})();
|
1894
|
+
// Auto-Register data-provide="slider" Elements
|
1895
|
+
$(function () {
|
1896
|
+
$("input[data-provide=slider]")[autoRegisterNamespace]();
|
1897
|
+
});
|
1886
1898
|
}
|
1887
1899
|
})($);
|
1888
1900
|
|