REFACTOR: Move Page title / focus / counts logic to service

We had a handful of methods attached to the root `Discourse` object
related to focus and notification counts.

This patch pulls them out into a service called `document-title` for
updating the title, and a component called `d-document` to attach
and listen for browser events related to focus.

It also removes some computed properties and observers in favor of plain
old Javascript objects.
This commit is contained in:
Robin Ward
2020-07-30 14:12:03 -04:00
parent 14eec43889
commit 92b26ecbfb
17 changed files with 253 additions and 287 deletions

View File

@@ -10,7 +10,8 @@ moduleFor("controller:topic", "controller:topic", {
needs: [
"controller:composer",
"controller:application",
"service:app-events"
"service:app-events",
"service:document-title"
],
beforeEach() {
this.registry.injection("controller", "appEvents", "service:app-events");