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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 09693acc7af3661cf88c98a559cb14cf9f682afd
|
4
|
+
data.tar.gz: 1747c97df93b6e68b6c460c79dfe8a01a4a5f14a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0460427a4457668e127434d4e04b047c8e565fa6c10641d60862cee2967ff52ae97b7cf247a766262c4b052cbf919e4871225951b2186db721c596038ee71b3d
|
7
|
+
data.tar.gz: 952f4673630170a3ee5ad7edc2272e39fc2bcfec0ec12e33954ee5733bd59fc9e4c69662a491e50ee262dd196d7dbdbfcf3b35932819c2f221efd9a0e16f81b0
|
@@ -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()
|