bootstrap-slider-rails 6.1.6 → 6.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92e1cdb3a8b7fb68a297428b00c2516fa3ca601e
|
4
|
+
data.tar.gz: 59c50ee18f9fd054fd800364be9a7267fc593cf9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ccebd6ba30e9b3d0e783f940ea8bffbcf303829169d96e63a9ccd3730c901f78267a1e6377a4863c0b9cdfb1854d48869f179a2c8914754d28aa9959eed48cf1
|
7
|
+
data.tar.gz: 3ec6e025d878d67a667fb867f4db6ebd393dbddc25187e61bb5d41b15e7a049c1746f76adfc3c1c5c6652fa9216e655faa8e3f59b39ac0adde467637c56bca4e
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/*! =======================================================
|
2
|
-
VERSION 6.1.
|
2
|
+
VERSION 6.1.8
|
3
3
|
========================================================= */
|
4
4
|
"use strict";
|
5
5
|
|
@@ -521,6 +521,9 @@ function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.const
|
|
521
521
|
|
522
522
|
this.touchCapable = 'ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch;
|
523
523
|
|
524
|
+
this.touchX = 0;
|
525
|
+
this.touchY = 0;
|
526
|
+
|
524
527
|
this.tooltip = this.sliderElem.querySelector('.tooltip-main');
|
525
528
|
this.tooltipInner = this.tooltip.querySelector('.tooltip-inner');
|
526
529
|
|
@@ -647,9 +650,13 @@ function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.const
|
|
647
650
|
this.handle2.addEventListener("keydown", this.handle2Keydown, false);
|
648
651
|
|
649
652
|
this.mousedown = this._mousedown.bind(this);
|
653
|
+
this.touchstart = this._touchstart.bind(this);
|
654
|
+
this.touchmove = this._touchmove.bind(this);
|
655
|
+
|
650
656
|
if (this.touchCapable) {
|
651
657
|
// Bind touch handlers
|
652
|
-
this.sliderElem.addEventListener("touchstart", this.
|
658
|
+
this.sliderElem.addEventListener("touchstart", this.touchstart, false);
|
659
|
+
this.sliderElem.addEventListener("touchmove", this.touchmove, false);
|
653
660
|
}
|
654
661
|
this.sliderElem.addEventListener("mousedown", this.mousedown, false);
|
655
662
|
|
@@ -914,7 +921,8 @@ function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.const
|
|
914
921
|
if (this.hideTooltip) {
|
915
922
|
this.sliderElem.removeEventListener("mouseleave", this.hideTooltip, false);
|
916
923
|
}
|
917
|
-
this.sliderElem.removeEventListener("touchstart", this.
|
924
|
+
this.sliderElem.removeEventListener("touchstart", this.touchstart, false);
|
925
|
+
this.sliderElem.removeEventListener("touchmove", this.touchmove, false);
|
918
926
|
this.sliderElem.removeEventListener("mousedown", this.mousedown, false);
|
919
927
|
|
920
928
|
// Remove window event listener
|
@@ -1216,6 +1224,16 @@ function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.const
|
|
1216
1224
|
|
1217
1225
|
return true;
|
1218
1226
|
},
|
1227
|
+
_touchstart: function _touchstart(ev) {
|
1228
|
+
if (ev.changedTouches === undefined) {
|
1229
|
+
this._mousedown(ev);
|
1230
|
+
return;
|
1231
|
+
}
|
1232
|
+
|
1233
|
+
var touch = ev.changedTouches[0];
|
1234
|
+
this.touchX = touch.pageX;
|
1235
|
+
this.touchY = touch.pageY;
|
1236
|
+
},
|
1219
1237
|
_triggerFocusOnHandle: function _triggerFocusOnHandle(handleIdx) {
|
1220
1238
|
if (handleIdx === 0) {
|
1221
1239
|
this.handle1.focus();
|
@@ -1298,6 +1316,27 @@ function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.const
|
|
1298
1316
|
|
1299
1317
|
return false;
|
1300
1318
|
},
|
1319
|
+
_touchmove: function _touchmove(ev) {
|
1320
|
+
if (ev.changedTouches === undefined) {
|
1321
|
+
return;
|
1322
|
+
}
|
1323
|
+
|
1324
|
+
var touch = ev.changedTouches[0];
|
1325
|
+
|
1326
|
+
var xDiff = touch.pageX - this.touchX;
|
1327
|
+
var yDiff = touch.pageY - this.touchY;
|
1328
|
+
|
1329
|
+
if (!this._state.inDrag) {
|
1330
|
+
// Vertical Slider
|
1331
|
+
if (this.options.orientation === 'vertical' && xDiff <= 5 && xDiff >= -5 && (yDiff >= 15 || yDiff <= -15)) {
|
1332
|
+
this._mousedown(ev);
|
1333
|
+
}
|
1334
|
+
// Horizontal slider.
|
1335
|
+
else if (yDiff <= 5 && yDiff >= -5 && (xDiff >= 15 || xDiff <= -15)) {
|
1336
|
+
this._mousedown(ev);
|
1337
|
+
}
|
1338
|
+
}
|
1339
|
+
},
|
1301
1340
|
_adjustPercentageForRangeSliders: function _adjustPercentageForRangeSliders(percentage) {
|
1302
1341
|
if (this.options.range) {
|
1303
1342
|
var precision = this._getNumDigitsAfterDecimalPlace(percentage);
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootstrap-slider-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.1.
|
4
|
+
version: 6.1.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pedr Browne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -97,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
99
|
rubyforge_project:
|
100
|
-
rubygems_version: 2.6.
|
100
|
+
rubygems_version: 2.6.3
|
101
101
|
signing_key:
|
102
102
|
specification_version: 4
|
103
103
|
summary: This Gem integrates Seiyara's fork of Bootstrap Slider with Rails, exposing
|