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>
- <button value="Cancel" class="danger">Cancel</button>
- <button value="Create" onclick="$(this).parent().submit();">Create</button>
- </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 = 'issue';
- apiCall(data,function(d){
- if(!d.error){
- back();
- }else{
- $('#loading').hide();
- }
- return false;
- });
- return false;
- }).find('.danger').click(function(){
- back();
- return false;
- });
- });
- </script>
- {{else}}
- <script>
- $(document).ready(function(){
- back();
- });
- </script>
- {{/if}}
|