Merge pull request #122 from tiwilliam/cancel-edit-key

ui: Add cancel button to key edit
This commit is contained in:
Armon Dadgar 2014-05-04 18:10:03 -07:00
commit 6440fc77b6
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");