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: 87fe69c3b652fbc23e701b48eb78f32e6c5b2282
4
- data.tar.gz: 65ba17b55a6f34aa3a25d6f678858c308fceea90
3
+ metadata.gz: 1d24449dd008acb63caf4903df28f336ad44deb8
4
+ data.tar.gz: 85bfd8c7910bb5dcda18574c373b5ad2363ff8ae
5
5
  SHA512:
6
- metadata.gz: fb3f41b36a30ae8e4980de629ce6ab2f44fe19571b4db4c882409b1dd85606e2509733e554d34089f69ee901186fb4bf36c03d8c1e7e03338b84ae599b21d6b6
7
- data.tar.gz: 79e582751ea0722846f0c293861b47ca84637a55de59544f896e504e9ea0829b692375509d53fcdc8762acffd5dd93478b63cfbd25610716a8fc52a2edf2a2fc
6
+ metadata.gz: 379ae810af5e0ebfe2b331338297ce2cfd2e9f013193c6b507e98dbdde17e8d3a7114b26fd856fabeb6a40d975d7edf858b1d8cbf8e4cce53182597ba1c8c7df
7
+ data.tar.gz: 034e310a3c65ee8476250b625cd7361643f7e09771562e33e2a07183920f8325829f385189e442407c58c2ba0d91e03e8a1086072e9dd1598b1b3666877cff53
@@ -1,5 +1,5 @@
1
1
  module BootstrapSlider
2
2
  module Rails
3
- VERSION = '5.3.1'
3
+ VERSION = '5.3.2'
4
4
  end
5
5
  end
@@ -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 = 0; i < this.options.ticks_positions.length; i++) {
213
+ for (var i = 1; i < this.options.ticks_positions.length; i++) {
213
214
  if (percentage <= this.options.ticks_positions[i]) {
214
- minv = (i > 0) ? this.options.ticks[i-1] : 0;
215
- minp = (i > 0) ? this.options.ticks_positions[i-1] : 0;
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
- if (i > 0) {
223
- var partialPercentage = (percentage - minp) / (maxp - minp);
224
- rawValue = minv + partialPercentage * (maxv - minv);
225
- }
223
+ var partialPercentage = (percentage - minp) / (maxp - minp);
224
+ rawValue = minv + partialPercentage * (maxv - minv);
225
+ shouldAdjustWithBase = false;
226
226
  }
227
227
 
228
- var value = this.options.min + Math.round(rawValue / this.options.step) * this.options.step;
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.1
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-30 00:00:00.000000000 Z
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.0
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