formagic 0.3.7 → 0.3.8
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 15c1f064f1b01b4388e86e70974a0c75213fc5bf
|
|
4
|
+
data.tar.gz: 633b109c4479ae67b2f39757ccec3da53112542e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dd7dd54998f2a9474add3be59b0ee99e7fe2ad4d562b5c6e74169a20e242ba29ffebb18749d16977fcd25a335031b125bfffcdb74560b5173512a5ea515bfdd2
|
|
7
|
+
data.tar.gz: c3e779c4ba42167afc1fd0263e38600e50077c7e40cd0e18b537fbdab511b66614b772b887a4280558ddda824f3713f830640f838ee1a8b4050b297bd3b1c4c4
|
|
@@ -37,31 +37,10 @@ class @InputCheckbox extends InputString
|
|
|
37
37
|
|
|
38
38
|
updateValue: (@value) ->
|
|
39
39
|
@$input.prop('checked', @_safe_value())
|
|
40
|
+
@$input.trigger('change')
|
|
40
41
|
|
|
41
42
|
hash: (hash={}) ->
|
|
42
43
|
hash[@config.klassName] = @$input.prop('checked')
|
|
43
44
|
return hash
|
|
44
45
|
|
|
45
46
|
chr.formInputs['checkbox'] = InputCheckbox
|
|
46
|
-
|
|
47
|
-
# -----------------------------------------------------------------------------
|
|
48
|
-
# INPUT CHECKBOX SWITCH
|
|
49
|
-
# -----------------------------------------------------------------------------
|
|
50
|
-
class @InputCheckboxSwitch extends InputCheckbox
|
|
51
|
-
|
|
52
|
-
# PRIVATE ===================================================================
|
|
53
|
-
|
|
54
|
-
_add_input: ->
|
|
55
|
-
@$switch =$ "<div class='switch'>"
|
|
56
|
-
@$el.append @$switch
|
|
57
|
-
|
|
58
|
-
@$false_hidden_input =$ "<input type='hidden' name='#{ @name }' value='false' />"
|
|
59
|
-
@$switch.append @$false_hidden_input
|
|
60
|
-
|
|
61
|
-
@$input =$ "<input type='checkbox' id='#{ @name }' name='#{ @name }' value='true' #{ if @_safe_value() then 'checked' else '' } />"
|
|
62
|
-
@$switch.append @$input
|
|
63
|
-
|
|
64
|
-
@$checkbox =$ "<div class='checkbox'>"
|
|
65
|
-
@$switch.append @$checkbox
|
|
66
|
-
|
|
67
|
-
chr.formInputs['switch'] = InputCheckboxSwitch
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# -----------------------------------------------------------------------------
|
|
2
|
+
# Author: Alexander Kravets <alex@slatestudio.com>,
|
|
3
|
+
# Slate Studio (http://www.slatestudio.com)
|
|
4
|
+
# -----------------------------------------------------------------------------
|
|
5
|
+
# INPUT CHECKBOX SWITCH
|
|
6
|
+
# -----------------------------------------------------------------------------
|
|
7
|
+
class @InputCheckboxSwitch extends InputCheckbox
|
|
8
|
+
|
|
9
|
+
# PRIVATE ===================================================================
|
|
10
|
+
|
|
11
|
+
_add_input: ->
|
|
12
|
+
@$switch =$ "<div class='switch'>"
|
|
13
|
+
@$el.append @$switch
|
|
14
|
+
|
|
15
|
+
@$false_hidden_input =$ "<input type='hidden' name='#{ @name }' value='false' />"
|
|
16
|
+
@$switch.append @$false_hidden_input
|
|
17
|
+
|
|
18
|
+
@$input =$ "<input type='checkbox' id='#{ @name }' name='#{ @name }' value='true' #{ if @_safe_value() then 'checked' else '' } />"
|
|
19
|
+
@$switch.append @$input
|
|
20
|
+
|
|
21
|
+
@$checkbox =$ "<div class='checkbox'>"
|
|
22
|
+
@$switch.append @$checkbox
|
|
23
|
+
|
|
24
|
+
chr.formInputs['switch'] = InputCheckboxSwitch
|
data/lib/formagic/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: formagic
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alexander Kravets
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-12-
|
|
11
|
+
date: 2015-12-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bourbon
|
|
@@ -117,6 +117,7 @@ files:
|
|
|
117
117
|
- app/assets/javascripts/formagic/inputs/select2_multiple.coffee
|
|
118
118
|
- app/assets/javascripts/formagic/inputs/select2_single.coffee
|
|
119
119
|
- app/assets/javascripts/formagic/inputs/string.coffee
|
|
120
|
+
- app/assets/javascripts/formagic/inputs/switch.coffee
|
|
120
121
|
- app/assets/javascripts/formagic/inputs/text.coffee
|
|
121
122
|
- app/assets/javascripts/formagic/inputs/time.coffee
|
|
122
123
|
- app/assets/javascripts/formagic/inputs/url.coffee
|