diff --git a/core/client/assets/sass/components/settings-menu.scss b/core/client/assets/sass/components/settings-menu.scss index 084570ca08..ab6504e038 100644 --- a/core/client/assets/sass/components/settings-menu.scss +++ b/core/client/assets/sass/components/settings-menu.scss @@ -143,6 +143,23 @@ height: 108px; } + .tag-delete-button { + padding: 0; + color: $red; + + &:before { + margin-right: 4px; + top: -1px; + position: relative; + } + + &:hover { + &, &:before { + color: darken($red, 10%); + } + } + } + .nav-list { margin-top: 3rem; } diff --git a/core/client/controllers/modals/delete-tag.js b/core/client/controllers/modals/delete-tag.js new file mode 100644 index 0000000000..60b4fb8648 --- /dev/null +++ b/core/client/controllers/modals/delete-tag.js @@ -0,0 +1,34 @@ +var DeleteTagController = Ember.Controller.extend({ + actions: { + confirmAccept: function () { + var tag = this.get('model'), + name = tag.get('name'), + self = this; + + this.send('closeSettingsMenu'); + + tag.destroyRecord().then(function () { + self.notifications.showSuccess('Deleted ' + name); + }).catch(function (error) { + self.notifications.showAPIError(error); + }); + }, + + confirmReject: function () { + return false; + } + }, + + confirm: { + accept: { + text: 'Delete', + buttonClass: 'btn btn-red' + }, + reject: { + text: 'Cancel', + buttonClass: 'btn btn-default btn-minor' + } + } +}); + +export default DeleteTagController; diff --git a/core/client/controllers/settings/tags.js b/core/client/controllers/settings/tags.js index ea6239cf82..606cfdd440 100644 --- a/core/client/controllers/settings/tags.js +++ b/core/client/controllers/settings/tags.js @@ -114,19 +114,6 @@ var TagsController = Ember.ArrayController.extend(PaginationMixin, { this.send('openSettingsMenu'); }, - deleteTag: function (tag) { - var name = tag.get('name'), - self = this; - - this.send('closeSettingsMenu'); - - tag.destroyRecord().then(function () { - self.notifications.showSuccess('Deleted ' + name); - }).catch(function (error) { - self.notifications.showAPIError(error); - }); - }, - saveActiveTagName: function (name) { this.saveActiveTagProperty('name', name); }, diff --git a/core/client/templates/modals/delete-tag.hbs b/core/client/templates/modals/delete-tag.hbs new file mode 100644 index 0000000000..240cb0516c --- /dev/null +++ b/core/client/templates/modals/delete-tag.hbs @@ -0,0 +1,6 @@ +{{#gh-modal-dialog action="closeModal" showClose=true type="action" style="wide,centered" animation="fade" + title="Are you sure you want to delete this tag?" confirm=confirm}} + +
You're about to delete "{{model.name}}".
This is permanent! No backups, no restores, no magic undo button.
We warned you, ok?