0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-10 23:36:14 -05:00

Fix alerts disappearing when navigating

closes #5707
- fix disappearing alerts after transitions by not clearing all alerts/notifications when closing menus
- remove `notifications.closeNotifications()` calls left over from needing to clear validation notifications
This commit is contained in:
Kevin Ansfield 2015-08-24 15:46:18 +01:00
parent 2b030c7370
commit 04e2e0e735
8 changed files with 3 additions and 16 deletions

View file

@ -44,7 +44,6 @@ export default Ember.Controller.extend(ValidationEngine, {
$('#login').find('input').trigger('change'); $('#login').find('input').trigger('change');
this.validate({format: false}).then(function () { this.validate({format: false}).then(function () {
self.get('notifications').closeNotifications();
self.send('authenticate'); self.send('authenticate');
}).catch(function (errors) { }).catch(function (errors) {
self.get('notifications').showErrors(errors); self.get('notifications').showErrors(errors);

View file

@ -37,7 +37,6 @@ export default Ember.Controller.extend({
this.set('uploadButtonText', 'Importing'); this.set('uploadButtonText', 'Importing');
this.set('importErrors', ''); this.set('importErrors', '');
notifications.closeNotifications();
formData.append('importfile', file); formData.append('importfile', file);

View file

@ -107,8 +107,6 @@ export default Ember.Controller.extend(SettingsSaveMixin, {
// we need to have navigationItems recomputed. // we need to have navigationItems recomputed.
this.get('model').notifyPropertyChange('navigation'); this.get('model').notifyPropertyChange('navigation');
notifications.closeNotifications();
return this.get('model').save().catch(function (err) { return this.get('model').save().catch(function (err) {
notifications.showErrors(err); notifications.showErrors(err);
}); });

View file

@ -50,7 +50,6 @@ export default Ember.Controller.extend(ValidationEngine, {
$('#login').find('input').trigger('change'); $('#login').find('input').trigger('change');
this.validate({property: 'signin'}).then(function () { this.validate({property: 'signin'}).then(function () {
self.get('notifications').closeNotifications();
self.toggleProperty('loggingIn'); self.toggleProperty('loggingIn');
self.send('authenticate'); self.send('authenticate');
}).catch(function (error) { }).catch(function (error) {

View file

@ -48,7 +48,6 @@ export default Ember.Controller.extend(ValidationEngine, {
notifications = this.get('notifications'); notifications = this.get('notifications');
this.set('flowErrors', ''); this.set('flowErrors', '');
notifications.closeNotifications();
this.validate().then(function () { this.validate().then(function () {
self.toggleProperty('submitting'); self.toggleProperty('submitting');

View file

@ -243,8 +243,7 @@ export default Ember.Mixin.create({
timedSaveId = this.get('timedSaveId'), timedSaveId = this.get('timedSaveId'),
self = this, self = this,
psmController = this.get('postSettingsMenuController'), psmController = this.get('postSettingsMenuController'),
promise, promise;
notifications = this.get('notifications');
options = options || {}; options = options || {};
@ -274,8 +273,6 @@ export default Ember.Mixin.create({
this.set('timedSaveId', null); this.set('timedSaveId', null);
} }
notifications.closeNotifications();
// Set the properties that are indirected // Set the properties that are indirected
// set markdown equal to what's in the editor, minus the image markers. // set markdown equal to what's in the editor, minus the image markers.
this.set('model.markdown', this.get('editor').getValue()); this.set('model.markdown', this.get('editor').getValue());

View file

@ -8,11 +8,8 @@ var Router = Ember.Router.extend({
notifications: Ember.inject.service(), notifications: Ember.inject.service(),
clearNotifications: Ember.on('didTransition', function () { displayDelayedNotifications: Ember.on('didTransition', function () {
var notifications = this.get('notifications'); this.get('notifications').displayDelayed();
notifications.closeNotifications();
notifications.displayDelayed();
}) })
}); });

View file

@ -40,7 +40,6 @@ export default Ember.Route.extend(ApplicationRouteMixin, ShortcutsRoute, {
closeMenus: function () { closeMenus: function () {
this.get('dropdown').closeDropdowns(); this.get('dropdown').closeDropdowns();
this.get('notifications').closeAll();
this.send('closeModal'); this.send('closeModal');
this.controller.setProperties({ this.controller.setProperties({
showSettingsMenu: false, showSettingsMenu: false,