formagic 0.3.7 → 0.3.8

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: d5205dd5e3ddafa7276e8a5161583b6e333b617b
4
- data.tar.gz: d907a83d3a27bd871fc63daac5652df3b5462a81
3
+ metadata.gz: 15c1f064f1b01b4388e86e70974a0c75213fc5bf
4
+ data.tar.gz: 633b109c4479ae67b2f39757ccec3da53112542e
5
5
  SHA512:
6
- metadata.gz: a72c34af4b24689d63558c71486fbab97dc6c2f9fb63e87abf4e5180a51a52ac4c2f86c443cea35ea4905399f66a02bad293a70b9bfc0869e0bd6e9b58434912
7
- data.tar.gz: d6284b2fdfa70629ef52a90e1fdf50df8d366057a42d92cb3fb81555c6226e4449bec5f9c134a9ea362c1c48168afe1a2eea928c4f8317cd2dcd63c248e24dcc
6
+ metadata.gz: dd7dd54998f2a9474add3be59b0ee99e7fe2ad4d562b5c6e74169a20e242ba29ffebb18749d16977fcd25a335031b125bfffcdb74560b5173512a5ea515bfdd2
7
+ data.tar.gz: c3e779c4ba42167afc1fd0263e38600e50077c7e40cd0e18b537fbdab511b66614b772b887a4280558ddda824f3713f830640f838ee1a8b4050b297bd3b1c4c4
@@ -5,6 +5,7 @@
5
5
  #= require ./formagic/inputs/string
6
6
  #= require ./formagic/inputs/text
7
7
  #= require ./formagic/inputs/checkbox
8
+ #= require ./formagic/inputs/switch
8
9
  #= require ./formagic/inputs/color
9
10
  #= require ./formagic/inputs/date
10
11
  #= require ./formagic/inputs/datetime
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Formagic
2
- VERSION = "0.3.7"
2
+ VERSION = "0.3.8"
3
3
  end
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.7
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-19 00:00:00.000000000 Z
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