MCPcopy Create free account
hub / github.com/ember-learn/ember-api-docs / constructor

Method constructor

app/routes/application.js:25–42  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23 routerScroll;
24
25 @service
26 shoebox;
27
28 constructor() {
29 super(...arguments);
30 if (!this.prerender.isPrerendering) {
31 this.router.on('routeDidChange', this.trackPage);
32
33 /* Hax from https://github.com/DockYard/ember-router-scroll/issues/263
34 to handle router scroll behavior when the page was initially served
35 pre-rendered
36 */
37 this.routerScroll.set('preserveScrollPosition', true);
38
39 setTimeout(() => {
40 if (!isDestroying(this) && !isDestroyed(this)) {
41 this.routerScroll.set('preserveScrollPosition', false);
42 }
43 }, 1000);
44 }
45

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected