formagic 0.3.0 → 0.3.1

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: 571f9dadd00731d428741b45677cc3e6d8f8afc6
4
- data.tar.gz: e9133e7c8253186d6d4003a8d4e590fc278f9704
3
+ metadata.gz: b35ec9359a82d93a94f59959d92bf8c321810604
4
+ data.tar.gz: aa5b70bc9e0815cee1ae537f653933e34fd995c8
5
5
  SHA512:
6
- metadata.gz: aecbde39dde0cd4b97b7c833731ca7d7ce4718ccd9a3d502db939587e3cd6bde5c7245e7d4c288800dc846f6f408154c439fef482d8ecbdaeb5ccc23ca7b883e
7
- data.tar.gz: 42190bef935b4670c816914d12800b4d52e574957c567c13cbbd7fef0113fa9bb48d8dc9c4e42d723cd551a3df1b9fd91d888abed93c4c866b99b7f039c80f41
6
+ metadata.gz: 7731dbcf8788171a9c06aa3f7624a5e12175a1497f2b9b81ad000f923b4b25d0cb0dfe67c720d3d4fc49b1d8b2a71bb04b5bad5116cc785ab975aadaab7ac667
7
+ data.tar.gz: 245afc4598580d133021adadb49313422425d366f13ac6c38600225d6f8a81ec9f314f7392fa314195237312dfe86e3b9fd62de514fe2cb362ab45cec4e0689d
@@ -33,6 +33,8 @@ class @InputMarkdown extends InputString
33
33
  _add_input: ->
34
34
  if @config.htmlFieldName
35
35
  @$inputHtml =$ "<input type='hidden' name='[#{ @config.htmlFieldName }]' />"
36
+ if @object
37
+ @$inputHtml.val(@object[@config.htmlFieldName])
36
38
  @$el.append @$inputHtml
37
39
 
38
40
  @$input =$ "<input type='hidden' name='#{ @name }' value='#{ @_safe_value() }' />"
@@ -78,6 +80,8 @@ class @InputMarkdown extends InputString
78
80
 
79
81
  @session.on 'change', (e) => @_update_inputs()
80
82
 
83
+ @_update_inputs()
84
+
81
85
  @config.onInitialize?(this)
82
86
 
83
87
 
@@ -86,6 +90,11 @@ class @InputMarkdown extends InputString
86
90
  @_update_inputs()
87
91
 
88
92
 
93
+ hash: (hash={}) ->
94
+ hash[@config.htmlFieldName] = @$inputHtml.val()
95
+ hash[@config.klassName] = @$input.val()
96
+ return hash
97
+
89
98
  chr.formInputs['markdown'] = InputMarkdown
90
99
 
91
100
 
@@ -1,3 +1,3 @@
1
1
  module Formagic
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
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.0
4
+ version: 0.3.1
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-10-11 00:00:00.000000000 Z
11
+ date: 2015-11-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bourbon