bootstrap-slider-rails 5.3.1 → 5.3.2
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: 1d24449dd008acb63caf4903df28f336ad44deb8
|
4
|
+
data.tar.gz: 85bfd8c7910bb5dcda18574c373b5ad2363ff8ae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 379ae810af5e0ebfe2b331338297ce2cfd2e9f013193c6b507e98dbdde17e8d3a7114b26fd856fabeb6a40d975d7edf858b1d8cbf8e4cce53182597ba1c8c7df
|
7
|
+
data.tar.gz: 034e310a3c65ee8476250b625cd7361643f7e09771562e33e2a07183920f8325829f385189e442407c58c2ba0d91e03e8a1086072e9dd1598b1b3666877cff53
|
@@ -207,25 +207,26 @@
|
|
207
207
|
linear: {
|
208
208
|
toValue: function(percentage) {
|
209
209
|
var rawValue = percentage/100 * (this.options.max - this.options.min);
|
210
|
+
var shouldAdjustWithBase = true;
|
210
211
|
if (this.options.ticks_positions.length > 0) {
|
211
212
|
var minv, maxv, minp, maxp = 0;
|
212
|
-
for (var i =
|
213
|
+
for (var i = 1; i < this.options.ticks_positions.length; i++) {
|
213
214
|
if (percentage <= this.options.ticks_positions[i]) {
|
214
|
-
minv =
|
215
|
-
minp =
|
215
|
+
minv = this.options.ticks[i-1];
|
216
|
+
minp = this.options.ticks_positions[i-1];
|
216
217
|
maxv = this.options.ticks[i];
|
217
218
|
maxp = this.options.ticks_positions[i];
|
218
219
|
|
219
220
|
break;
|
220
221
|
}
|
221
222
|
}
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
}
|
223
|
+
var partialPercentage = (percentage - minp) / (maxp - minp);
|
224
|
+
rawValue = minv + partialPercentage * (maxv - minv);
|
225
|
+
shouldAdjustWithBase = false;
|
226
226
|
}
|
227
227
|
|
228
|
-
var
|
228
|
+
var adjustment = shouldAdjustWithBase ? this.options.min : 0;
|
229
|
+
var value = adjustment + Math.round(rawValue / this.options.step) * this.options.step;
|
229
230
|
if (value < this.options.min) {
|
230
231
|
return this.options.min;
|
231
232
|
} else if (value > this.options.max) {
|
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: 5.3.
|
4
|
+
version: 5.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pedr Browne
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
98
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.5.
|
99
|
+
rubygems_version: 2.5.1
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: This Gem integrates Seiyara's fork of Bootstrap Slider with Rails, exposing
|