editor: dialog forms - setting initial value for text input fields
authorAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Sun, 23 Mar 2014 19:31:14 +0000 (20:31 +0100)
committerAleksander Łukasz <aleksander.lukasz@nowoczesnapolska.org.pl>
Sun, 23 Mar 2014 19:31:14 +0000 (20:31 +0100)
src/editor/views/dialog/dialog.js
src/editor/views/dialog/templates/input.html
src/editor/views/dialog/templates/textarea.html

index 0d4bbd4..0579464 100644 (file)
@@ -38,7 +38,7 @@ define(function(require) {
                     throw new Error('Field type {type} not recognized.'.replace('{type}', field.type));
                 }
                 body.append(
-                    _.template(template)(_.extend({description: ''}, field))
+                    _.template(template)(_.extend({description: '', initialValue: ''}, field))
                 );
             });
 
index f60f2f6..1600d87 100644 (file)
@@ -3,7 +3,7 @@
     <%= label %>:
     </div>
     <div>
-        <input type="input" name="<%= name %>"/>
+        <input type="input" name="<%= name %>" value="<%= initialValue %>"/>
         <span class="description"><%= description %></span>
     </div>
     
index 50b7c50..839e7f4 100644 (file)
@@ -1,5 +1,5 @@
 <p>
     <label><%= label %></label>
-    <textarea name="<%= name %>" rows="5"></textarea>
+    <textarea name="<%= name %>" rows="5"><%= initialValue %></textarea>
     <span class="description"><%= description %></span>
 </p>