0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-13 22:41:32 -05:00
ghost/core/client/controllers/modals/delete-post.js

37 lines
1.1 KiB
JavaScript
Raw Normal View History

2014-03-30 23:07:05 -05:00
var DeletePostController = Ember.Controller.extend({
actions: {
confirmAccept: function () {
var self = this,
model = this.get('model');
// definitely want to clear the data store and post of any unsaved, client-generated tags
model.updateTags();
model.destroyRecord().then(function () {
2014-09-28 10:39:25 -05:00
self.get('dropdown').closeDropdowns();
self.transitionToRoute('posts.index');
self.notifications.showSuccess('Your post has been deleted.', {delayed: true});
}, function () {
self.notifications.showError('Your post could not be deleted. Please try again.');
});
},
confirmReject: function () {
return false;
}
},
2014-03-30 23:07:05 -05:00
confirm: {
accept: {
text: 'Delete',
2014-08-06 06:34:08 -05:00
buttonClass: 'btn btn-red'
2014-03-30 23:07:05 -05:00
},
reject: {
text: 'Cancel',
2014-08-06 06:34:08 -05:00
buttonClass: 'btn btn-default btn-minor'
2014-03-30 23:07:05 -05:00
}
}
2014-03-30 23:07:05 -05:00
});
export default DeletePostController;