0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Remove unused top notification count functionality

no issue

- in a very old iteration of the admin design we needed a data attribute containing the number of notifications in order to add extra spacing in the styles. This hasn't been necessary for a long time and there are easier ways to do it now than using observers.
This commit is contained in:
Kevin Ansfield 2017-11-24 10:47:06 +00:00
parent d982f7b520
commit 1fb2b49a5b
3 changed files with 4 additions and 17 deletions

View file

@ -1,6 +1,5 @@
import Component from '@ember/component';
import {alias} from '@ember/object/computed';
import {observer} from '@ember/object';
import {inject as service} from '@ember/service';
export default Component.extend({
@ -9,9 +8,5 @@ export default Component.extend({
notifications: service(),
messages: alias('notifications.alerts'),
messageCountObserver: observer('messages.[]', function () {
this.sendAction('notify', this.get('messages').length);
})
messages: alias('notifications.alerts')
});

View file

@ -17,13 +17,5 @@ export default Controller.extend({
return (this.get('currentPath') !== 'error404' || this.get('session.isAuthenticated'))
&& !this.get('currentPath').match(/(signin|signup|setup|reset)/);
}),
topNotificationCount: 0,
actions: {
topNotificationChange(count) {
this.set('topNotificationCount', count);
}
}
})
});

View file

@ -1,14 +1,14 @@
{{#gh-app showSettingsMenu=ui.showSettingsMenu}}
{{#gh-skip-link anchor=".gh-main"}}Skip to main content{{/gh-skip-link}}
{{gh-alerts notify="topNotificationChange"}}
{{gh-alerts}}
<div class="gh-viewport {{if ui.autoNav 'gh-autonav'}} {{if ui.showSettingsMenu 'settings-menu-expanded'}} {{if ui.showMobileMenu 'mobile-menu-expanded'}}">
{{#if showNavMenu}}
{{gh-nav-menu open=ui.autoNavOpen}}
{{/if}}
{{#gh-main onMouseEnter=(action "closeAutoNav" target=ui) data-notification-count=topNotificationCount}}
{{#gh-main onMouseEnter=(action "closeAutoNav" target=ui)}}
{{outlet}}
{{/gh-main}}