Add cancel button to key edit

This commit is contained in:
William Tisäter 2014-05-05 01:03:47 +02:00
parent 6758a260a3
commit acc36c297f
2 changed files with 7 additions and 0 deletions

View File

@ -210,6 +210,7 @@
{{ textarea value=model.valueDecoded class="form-control"}} {{ textarea value=model.valueDecoded class="form-control"}}
</div> </div>
<button {{ action "updateKey"}} {{bind-attr disabled=isLoading }} {{ bind-attr class=":btn isLoading:btn-warning:btn-success" }}>Update</button> <button {{ action "updateKey"}} {{bind-attr disabled=isLoading }} {{ bind-attr class=":btn isLoading:btn-warning:btn-success" }}>Update</button>
<button {{ action "cancelEdit"}} {{bind-attr disabled=isLoading }} {{ bind-attr class=":btn isLoading:btn-warning:btn-default" }}>Cancel</button>
<button {{ action "deleteKey"}} {{bind-attr disabled=isLoading }} {{ bind-attr class=":btn :pull-right isLoading:btn-warning:btn-danger" }}>Delete</button> <button {{ action "deleteKey"}} {{bind-attr disabled=isLoading }} {{ bind-attr class=":btn :pull-right isLoading:btn-warning:btn-danger" }}>Delete</button>
</form> </form>
</div> </div>

View File

@ -143,6 +143,12 @@ App.KvEditController = Ember.Controller.extend({
}) })
}, },
cancelEdit: function() {
this.set('isLoading', true);
this.transitionToRoute('kv.show', this.get("model").get('parentKey'));
this.set('isLoading', false);
},
deleteKey: function() { deleteKey: function() {
this.set('isLoading', true); this.set('isLoading', true);
var key = this.get("model"); var key = this.get("model");