mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 02:11:44 +03:00
1c6216777c
Closes #3511, Closes #3512, Closes #3526 - show* methods now close existing passive notifications by default. They also now take an optional options object where existing parameters such as "delayed" and "defaultErrorText" can be passed in as well as the new "doNotClosePassive" flag. - Removed all explicit calls to notifications.closePassive except for the few places where it makes sense to call it separately.
37 lines
1.0 KiB
JavaScript
37 lines
1.0 KiB
JavaScript
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 () {
|
|
self.get('popover').closePopovers();
|
|
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;
|
|
}
|
|
},
|
|
confirm: {
|
|
accept: {
|
|
text: 'Delete',
|
|
buttonClass: 'button-delete'
|
|
},
|
|
reject: {
|
|
text: 'Cancel',
|
|
buttonClass: 'button'
|
|
}
|
|
}
|
|
});
|
|
|
|
export default DeletePostController;
|