mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
ee89b11a6a
issue #5409 - change persistent/passive notification status to alert/notification - replace showSuccess/Info/Warn/Error with showNotification/showAlert - fix and clean up notification/alert components
39 lines
1.0 KiB
JavaScript
39 lines
1.0 KiB
JavaScript
import Ember from 'ember';
|
|
|
|
export default Ember.Controller.extend({
|
|
dropdown: Ember.inject.service(),
|
|
notifications: Ember.inject.service(),
|
|
|
|
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('dropdown').closeDropdowns();
|
|
self.transitionToRoute('posts.index');
|
|
}, function () {
|
|
self.get('notifications').showAlert('Your post could not be deleted. Please try again.', {type: 'error'});
|
|
});
|
|
},
|
|
|
|
confirmReject: function () {
|
|
return false;
|
|
}
|
|
},
|
|
|
|
confirm: {
|
|
accept: {
|
|
text: 'Delete',
|
|
buttonClass: 'btn btn-red'
|
|
},
|
|
reject: {
|
|
text: 'Cancel',
|
|
buttonClass: 'btn btn-default btn-minor'
|
|
}
|
|
}
|
|
});
|