123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- {{#if key}}
- <form id="form">
- <div>
- <input type="text" name="title" class="fill-width" placeholder="Title"/>
- </div>
- <div>
- <textarea type="text" name="description" class="fill-width" placeholder="Description"/></textarea>
- </div>
- <div>
- <input type="button" value="cancel" class="cancel"/>
- <input type="submit" value="create"/>
- </div>
- </form>
- <script>
- $(document).ready(function(){
- $('form#form').submit(function(){
- var data = $(this).serializeObject(),
- State = History.getState();
- for(var i in State.data){
- data[i] = State.data;
- }
- data.type = 'action';
- data.id = 'project';
- apiCall(data,function(d){
- if(!d.error){
- back();
- }else{
- $('#loading').hide();
- }
- return false;
- });
- return false;
- }).find('.cancel').click(function(){
- back();
- return false;
- });
- });
- </script>
- {{else}}
- <script>
- $(document).ready(function(){
- back();
- });
- </script>
- {{/if}}
|