mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 10:21:36 +03:00
61361ac91b
Closes #3839 - Display a warning modal in the editor routes if the user is logged out due to re-authorization problems. This provides a chance to copy any unsaved content before being sent to the signin page to log back in.
35 lines
801 B
JavaScript
35 lines
801 B
JavaScript
var AuthFailedUnsavedController = Ember.Controller.extend({
|
|
editorController: Ember.computed.alias('model'),
|
|
|
|
actions: {
|
|
confirmAccept: function () {
|
|
var editorController = this.get('editorController');
|
|
|
|
if (editorController) {
|
|
editorController.get('model').rollback();
|
|
}
|
|
|
|
window.onbeforeunload = null;
|
|
|
|
window.location = this.get('ghostPaths').adminRoot + '/signin/';
|
|
},
|
|
|
|
confirmReject: function () {
|
|
|
|
}
|
|
},
|
|
|
|
confirm: {
|
|
accept: {
|
|
text: 'Leave',
|
|
buttonClass: 'btn btn-red'
|
|
},
|
|
reject: {
|
|
text: 'Stay',
|
|
buttonClass: 'btn btn-default btn-minor'
|
|
}
|
|
}
|
|
});
|
|
|
|
export default AuthFailedUnsavedController;
|