From 1fb2b49a5bf80abffa1ad18e618c1ad5e2881e49 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Fri, 24 Nov 2017 10:47:06 +0000 Subject: [PATCH] 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. --- ghost/admin/app/components/gh-alerts.js | 7 +------ ghost/admin/app/controllers/application.js | 10 +--------- ghost/admin/app/templates/application.hbs | 4 ++-- 3 files changed, 4 insertions(+), 17 deletions(-) diff --git a/ghost/admin/app/components/gh-alerts.js b/ghost/admin/app/components/gh-alerts.js index bdab2985b8..18df4f52f7 100644 --- a/ghost/admin/app/components/gh-alerts.js +++ b/ghost/admin/app/components/gh-alerts.js @@ -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') }); diff --git a/ghost/admin/app/controllers/application.js b/ghost/admin/app/controllers/application.js index 9bbf0654d6..8b13eb1d50 100644 --- a/ghost/admin/app/controllers/application.js +++ b/ghost/admin/app/controllers/application.js @@ -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); - } - } + }) }); diff --git a/ghost/admin/app/templates/application.hbs b/ghost/admin/app/templates/application.hbs index af9235a77d..4634eac730 100644 --- a/ghost/admin/app/templates/application.hbs +++ b/ghost/admin/app/templates/application.hbs @@ -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}}
{{#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}}