Merge pull request #521 from hoffoo/master

ui: ask for confirmation before deleting keys
This commit is contained in:
Armon Dadgar 2014-12-07 17:03:32 -08:00
commit f49f6c4ad3
1 changed files with 13 additions and 11 deletions

View File

@ -161,13 +161,14 @@ App.KvShowController.reopen({
},
deleteFolder: function() {
this.set('isLoading', true);
this.set('isLoading', true);
var controller = this;
var dc = controller.get('dc').get('datacenter');
var grandParent = controller.get('grandParentKey');
var token = App.get('settings.token');
if (window.confirm("Are you sure you want to delete this folder?")) {
// Delete the folder
Ember.$.ajax({
url: (formatUrl("/v1/kv/" + controller.get('parentKey') + '?recurse', dc, token)),
@ -180,6 +181,7 @@ App.KvShowController.reopen({
});
}
}
}
});
App.KvEditController = KvBaseController.extend({