@@ -209,6 +209,8 @@ module.exports =(Handlebars) ->
209
209
return " value='" + propValue + " '"
210
210
if dataType is " number"
211
211
return " value='" + numeral (propValue).value () + " '"
212
+ if dataType is " textarea"
213
+ return _ .escape (propValue)
212
214
else return " value='#{ _ .escape (propValue)} '"
213
215
" "
214
216
# Get the value of the translated label.
@@ -256,24 +258,29 @@ module.exports =(Handlebars) ->
256
258
# Deal with error
257
259
errors = ()=>
258
260
if error == " has-error" then " <span class='#{ error} #{ errorSize ()} help-inline pull-left' style='color:#b94a48'> #{ errorValue } </span>" else " "
261
+
262
+ openTag = ->
263
+ if opt .rows ? then " <textarea rows='#{ opt .rows } ' " else " <input"
264
+ closeTag = ->
265
+ if opt .rows ? then " >#{ propertyValue ()} </textarea>" else " #{ propertyValue ()} />"
259
266
# Build the html tag.
260
267
# <div class="form-group">
261
268
# <label for="exampleInputEmail">Email address</label>
262
269
# <input type="text" class="form-control" id="exampleInputEmail" placeholder="Enter email">
263
270
# </div>
264
271
if minimalHtml
265
- html = " <input id='#{ property} ' #{ dataFields (@ )} #{ decorator ()} #{ binder ()} class=''"
266
- html += " data-name='#{ property} ' type='#{ dataType} ' #{ inputAttributes} #{ cidAttr} #{ placeholder} #{ propertyValue () } #{ readonly } #{ disabled } /> "
272
+ html = " #{ openTag () } id='#{ property} ' #{ dataFields (@ )} #{ decorator ()} #{ binder ()} class=''"
273
+ html += " data-name='#{ property} ' type='#{ dataType} ' #{ inputAttributes} #{ cidAttr} #{ placeholder} #{ readonly } #{ disabled } #{ closeTag () } "
267
274
else
268
275
html = "
269
276
<div class='form-group #{ error} #{ col} '>
270
277
#{ label ()}
271
278
<div class='#{ inputSize ()} #{ containerCss} ' #{ containerAttribs} >
272
279
<div class='#{ if isAddOnInput then ' input-group' else " " } '>
273
280
#{ icon ()}
274
- <input id='#{ property} ' #{ decorator ()} #{ binder ()} #{ dataFields (@ )} class='"
281
+ #{ openTag () } id='#{ property} ' #{ decorator ()} #{ binder ()} #{ dataFields (@ )} class='"
275
282
if (dataType != " checkbox" ) then html += " form-control "
276
- html += " input-sm' data-name='#{ property} ' type='#{ dataType} ' #{ inputAttributes} #{ placeholder} #{ propertyValue () } #{ readonly } #{ disabled } />
283
+ html += " input-sm' data-name='#{ property} ' type='#{ dataType} ' #{ inputAttributes} #{ placeholder} #{ readonly } #{ disabled } #{ closeTag () }
277
284
#{ symbol ()} "
278
285
if (dataType != " checkbox" ) then html += " #{ isRequired ()} " else html += " "
279
286
0 commit comments