nouislider-rails 6.1.0 → 6.2.0

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: 8c836710318e117437b0d7f90ee0208a50214103
4
- data.tar.gz: c2f2a7fac403d92f029e1490ba3986e55e040f97
3
+ metadata.gz: 771bf6eaf58408a1ed66141442a0ea0fa2de4696
4
+ data.tar.gz: 5d85915476ef2157cc0b967c01df142a4d390a8c
5
5
  SHA512:
6
- metadata.gz: 7107eca155b0c8861b5993e252a65b57200c2ee09d211697fed7e898ba71173fe45ecdc280ae984c53e33eb74e64d7c96dd50dbc975adb929158107ca0305f9c
7
- data.tar.gz: 5cde020e4e9a4858e4d0ef526d511c90f728bc03754ba033cebb889ad60874ed3de015d0109a43b552de315c3e28385d5964d22585ee53f8310576db675808b2
6
+ metadata.gz: 66145151895bb866e118aaa9d05ba324ba9f4798db08d569bd7d18639830b9ceac8f38feccf1b106feb5a2499b8526faa02c8b98e8ce2e6e3e5e980754fc6844
7
+ data.tar.gz: c313eab3fae3d4ba8bc11deed6e2b5b622c8d676fb5b35142a7d3e6bbd128b595c1f08916329177eeeb4d68c69eec90c7c344d9699ec6f708962ba8ed3e4e95b
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Nouislider::Rails
2
2
 
3
- Currently tracking 6.0 of jquery-noUiSlider: http://refreshless.com/nouislider/. All credit and thanks to @leongersen for the awesome library.
3
+ Currently tracking 6.2.0 of jquery-noUiSlider: http://refreshless.com/nouislider/. All credit and thanks to @leongersen for the awesome library.
4
4
  Sorry for not naming it jquery-nouislider-rails, but someone else started another gem a few months ago here (https://github.com/soycamo/jquery-nouislider-rails).
5
5
 
6
6
  ![screenshot from homepage](https://raw.github.com/chug2k/nouislider-rails/master/screenshot.png)
@@ -25,6 +25,10 @@ In your app/assets/javascript manifest file:
25
25
 
26
26
  //= require jquery.nouislider
27
27
 
28
+ If you want to use the `$.Link` feature you would also need to add:
29
+
30
+ //= require Link
31
+
28
32
  In your app/assets/stylesheets manifest file:
29
33
 
30
34
  //= require jquery.nouislider
@@ -1,5 +1,5 @@
1
1
  module Nouislider
2
2
  module Rails
3
- VERSION = "6.1.0"
3
+ VERSION = "6.2.0"
4
4
  end
5
5
  end
@@ -9,7 +9,7 @@ Gem::Specification.new do |spec|
9
9
  spec.authors = ["Charles Lee"]
10
10
  spec.email = ["chug2k@gmail.com"]
11
11
  spec.summary = "jquery-nouislider.js for the Rails asset pipeline."
12
- spec.description = "Currently tracking 6.1 of jquery-noUiSlider: https://github.com/leongersen/noUiSlider). All credit and thanks to @leongersen for the awesome library."
12
+ spec.description = "Currently tracking #{Nouislider::Rails::VERSION} of jquery-noUiSlider: https://github.com/leongersen/noUiSlider). All credit and thanks to @leongersen for the awesome library."
13
13
  spec.homepage = "https://github.com/chug2k/nouislider-rails"
14
14
  spec.license = "MIT"
15
15
 
@@ -386,4 +386,4 @@ var
386
386
  /** @expose */
387
387
  $.Link = Link;
388
388
 
389
- }( window['jQuery'] || window['Zepto'] ));
389
+ }( window['jQuery'] || window['Zepto'] ));
@@ -15,6 +15,9 @@ $.fn.noUiSlider - WTFPL - refreshless.com/nouislider/ */
15
15
  // Cache the document selector;
16
16
  /** @const */
17
17
  doc = $(document),
18
+ // Make a backup of the original jQuery/Zepto .val() method.
19
+ /** @const */
20
+ $val = $.fn.val,
18
21
  // Namespace for binding and unbinding slider events;
19
22
  /** @const */
20
23
  namespace = '.nui',
@@ -164,7 +167,10 @@ $.fn.noUiSlider - WTFPL - refreshless.com/nouislider/ */
164
167
  function getStep ( options, value ){
165
168
 
166
169
  var j = 1, a, b;
167
- while ( value >= options.xPct[j] ){
170
+
171
+ // Find the proper step for rtl sliders by search in inverse direction.
172
+ // Fixes issue #262.
173
+ while ( (options.dir ? (100 - value) : value) >= options.xPct[j] ){
168
174
  j++;
169
175
  }
170
176
 
@@ -266,6 +272,12 @@ $.fn.noUiSlider - WTFPL - refreshless.com/nouislider/ */
266
272
  throw new Error("noUiSlider: 'range' is not an object.");
267
273
  }
268
274
 
275
+ // Catch missing start or end.
276
+ if ( entry['min'] === undefined ||
277
+ entry['max'] === undefined ) {
278
+ throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");
279
+ }
280
+
269
281
  // Loop all entries.
270
282
  $.each( entry, function ( index, value ) {
271
283
 
@@ -506,15 +518,16 @@ $.fn.noUiSlider - WTFPL - refreshless.com/nouislider/ */
506
518
  ,margin: 0
507
519
  }, tests;
508
520
 
521
+ // Tests are executed in the order they are presented here.
509
522
  tests = {
510
523
  'step': { r: false, t: testStep },
511
- 'range': { r: true, t: testRange },
512
524
  'start': { r: true, t: testStart },
513
- 'snap': { r: false, t: testSnap },
514
525
  'connect': { r: true, t: testConnect },
526
+ 'direction': { r: true, t: testDirection },
527
+ 'range': { r: true, t: testRange },
528
+ 'snap': { r: false, t: testSnap },
515
529
  'orientation': { r: false, t: testOrientation },
516
530
  'margin': { r: false, t: testMargin },
517
- 'direction': { r: true, t: testDirection },
518
531
  'behaviour': { r: true, t: testBehaviour },
519
532
  'serialization': { r: true, t: testSerialization }
520
533
  };
@@ -1235,6 +1248,35 @@ function closure ( target, options, originalOptions ){
1235
1248
  });
1236
1249
  }
1237
1250
 
1251
+ // Access the internal getting and setting methods based on argument count.
1252
+ function value ( ) {
1253
+ return this[0][ !arguments.length ? 'vGet' : 'vSet' ].apply(this[0], arguments);
1254
+ }
1255
+
1256
+ // Override the .val() method. Test every element. Is it a slider? Go to
1257
+ // the slider value handling. No? Use the standard method.
1258
+ // Note how $.fn.val extects 'this' to be an instance of $. For convenience,
1259
+ // the above 'value' function does too.
1260
+ $.fn.val = function ( ) {
1261
+
1262
+ // this === instanceof $
1263
+
1264
+ function valMethod( a ){
1265
+ return a.hasClass(Classes[0]) ? value : $val;
1266
+ }
1267
+
1268
+ var args = arguments,
1269
+ first = $(this[0]);
1270
+
1271
+ if ( !arguments.length ) {
1272
+ return valMethod(first).call(first);
1273
+ }
1274
+
1275
+ // Return the set so it remains chainable
1276
+ return this.each(function(){
1277
+ valMethod($(this)).apply($(this), args);
1278
+ });
1279
+ };
1238
1280
 
1239
1281
  // Remap the serialization constructor for legacy support.
1240
1282
  /** @expose */
@@ -1246,7 +1288,4 @@ function closure ( target, options, originalOptions ){
1246
1288
  return ( re ? rebuild : initialize ).call(this, options);
1247
1289
  };
1248
1290
 
1249
- // Attach a classbased val handler.
1250
- $.classVal(Classes[0], 'vGet', 'vSet', false);
1251
-
1252
- }( window['jQuery'] || window['Zepto'] ));
1291
+ }( window['jQuery'] || window['Zepto'] ));
@@ -162,4 +162,4 @@
162
162
  }
163
163
  [disabled] .noUi-handle {
164
164
  cursor: not-allowed;
165
- }
165
+ }
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nouislider-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.0
4
+ version: 6.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Charles Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-07 00:00:00.000000000 Z
11
+ date: 2014-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -52,7 +52,7 @@ dependencies:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
- description: 'Currently tracking 6.1 of jquery-noUiSlider: https://github.com/leongersen/noUiSlider).
55
+ description: 'Currently tracking 6.2.0 of jquery-noUiSlider: https://github.com/leongersen/noUiSlider).
56
56
  All credit and thanks to @leongersen for the awesome library.'
57
57
  email:
58
58
  - chug2k@gmail.com