mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-13 22:41:32 -05:00
4898f721ee
No issue -inject popover:service into modal component delete post controller so popover close can be triggered as part of the delete action -remove unnecessary 'needs' from the delete post controller
32 lines
875 B
JavaScript
32 lines
875 B
JavaScript
var DeletePostController = Ember.Controller.extend({
|
|
actions: {
|
|
confirmAccept: function () {
|
|
var self = this;
|
|
|
|
this.get('model').destroyRecord().then(function () {
|
|
self.get('popover').closePopovers();
|
|
self.notifications.showSuccess('Your post has been deleted.');
|
|
self.transitionToRoute('posts.index');
|
|
}, function () {
|
|
self.notifications.showError('Your post could not be deleted. Please try again.');
|
|
});
|
|
|
|
},
|
|
|
|
confirmReject: function () {
|
|
return false;
|
|
}
|
|
},
|
|
confirm: {
|
|
accept: {
|
|
text: 'Delete',
|
|
buttonClass: 'button-delete'
|
|
},
|
|
reject: {
|
|
text: 'Cancel',
|
|
buttonClass: 'button'
|
|
}
|
|
}
|
|
});
|
|
|
|
export default DeletePostController;
|