simple_form_extension 1.2.1 → 1.2.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: 5e75ad7275cf12c8eac28ce92d131b354cdac533
4
- data.tar.gz: 84e169abb262b13c9e881dc79d1406fac6c2c9b4
3
+ metadata.gz: 09693acc7af3661cf88c98a559cb14cf9f682afd
4
+ data.tar.gz: 1747c97df93b6e68b6c460c79dfe8a01a4a5f14a
5
5
  SHA512:
6
- metadata.gz: debf714f2d4c8eddf191e43facec0cbbedcb39a39197e1092d83f8bc51dddd35edbd26aca502b6246736ea47b0ed6d4ee103b912f30d77aa02323cac62dca4f7
7
- data.tar.gz: 767cb54dea42c7aca292ef2e23c75807d5061da34699e176610a0e38c574076279ab5862d28a6777d289173dce91904ad168b80b145b6a567dab5f79be542766
6
+ metadata.gz: 0460427a4457668e127434d4e04b047c8e565fa6c10641d60862cee2967ff52ae97b7cf247a766262c4b052cbf919e4871225951b2186db721c596038ee71b3d
7
+ data.tar.gz: 952f4673630170a3ee5ad7edc2272e39fc2bcfec0ec12e33954ee5733bd59fc9e4c69662a491e50ee262dd196d7dbdbfcf3b35932819c2f221efd9a0e16f81b0
@@ -1,3 +1,3 @@
1
1
  module SimpleFormExtension
2
- VERSION = "1.2.1"
2
+ VERSION = "1.2.2"
3
3
  end
@@ -1,17 +1,16 @@
1
1
  class Spinbox
2
2
  constructor: (@$el) ->
3
- @el = @$el[0]
4
-
5
3
  @$el.spinbox(max: Number.POSITIVE_INFINITY)
6
4
 
5
+
6
+ $.fn.simpleFormSpinbox = ->
7
+ @each (i, el) ->
8
+ $input = $(el)
9
+ return if $input.data('simple-form:spinbox')
10
+ instance = new Spinbox($input)
11
+ $input.data('simple-form:spinbox', instance)
7
12
 
8
13
  onPageReady ->
9
14
  $spinbox = $('.spinner-box-input')
10
-
11
15
  return unless $spinbox.length
12
-
13
- $spinbox.each (i, el) ->
14
- $spinner = $(el)
15
- return if $spinner.data('simple-form:spinner')
16
- instance = new Spinbox($spinner)
17
- $spinner.data('simple-form:spinner', instance)
16
+ $spinbox.simpleFormSpinbox()
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form_extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexandre Vasseur