diff --git a/addon/index.js b/addon/index.js index 9219964d..85ec46f1 100644 --- a/addon/index.js +++ b/addon/index.js @@ -1,8 +1,8 @@ -import Mixin from '@ember/object/mixin' -import { get, computed } from '@ember/object' -import { inject } from '@ember/service' -import { getOwner } from '@ember/application' -import { scheduleOnce } from '@ember/runloop' +import Mixin from '@ember/object/mixin'; +import { get, computed } from '@ember/object'; +import { inject } from '@ember/service'; +import { getOwner } from '@ember/application'; +import { scheduleOnce } from '@ember/runloop'; export default Mixin.create({ scheduler: inject('scheduler'), @@ -26,30 +26,30 @@ export default Mixin.create({ if (get(this, 'isFastBoot')) { return; } - const delayScrollTop = get(this, 'service.delayScrollTop') + const delayScrollTop = get(this, 'service.delayScrollTop'); if (!delayScrollTop) { - scheduleOnce('render', this, () => this.updateScrollPosition(transitions)) + scheduleOnce('render', this, () => this.updateScrollPosition(transitions)); } else { // as described in ember-app-scheduler, this addon can be used to delay rendering until after First Meaningful Paint. // If you loading your routes progressively, this may be a good option to delay scrollTop until the remaining DOM elements are painted. this.get('scheduler').scheduleWork('afterContentPaint', () => { - this.updateScrollPosition(transitions) - }) + this.updateScrollPosition(transitions); + }); } }, updateScrollPosition (transitions) { - const lastTransition = transitions[transitions.length - 1] + const lastTransition = transitions[transitions.length - 1]; let routerPath if (typeof get(lastTransition, 'handler._router') !== 'undefined') { - routerPath = 'handler._router' + routerPath = 'handler._router'; } else { - routerPath = 'handler.router' + routerPath = 'handler.router'; } - const url = get(lastTransition, `${routerPath}.currentURL`) - const hashElement = url ? document.getElementById(url.split('#').pop()) : null + const url = get(lastTransition, `${routerPath}.currentURL`); + const hashElement = url ? document.getElementById(url.split('#').pop()) : null; let scrollPosition; diff --git a/addon/locations/router-scroll.js b/addon/locations/router-scroll.js index 1d92d7a1..44673051 100644 --- a/addon/locations/router-scroll.js +++ b/addon/locations/router-scroll.js @@ -1,4 +1,3 @@ -/* eslint-disable */ import HistoryLocation from '@ember/routing/history-location'; import { set, get } from '@ember/object'; diff --git a/addon/services/router-scroll.js b/addon/services/router-scroll.js index 06c8b39c..2e05d55b 100644 --- a/addon/services/router-scroll.js +++ b/addon/services/router-scroll.js @@ -1,4 +1,3 @@ -/* eslint-disable */ import Service from '@ember/service'; import { getWithDefault, computed, set, get } from '@ember/object'; import { typeOf } from '@ember/utils'; @@ -52,7 +51,7 @@ export default Service.extend({ const scrollMap = get(this, 'scrollMap'); const stateUuid = get(window, 'history.state.uuid'); - set(this, 'key', stateUuid); + set(this, 'key', stateUuid); // eslint-disable-line ember/no-side-effects const key = getWithDefault(this, 'key', '-1'); return getWithDefault(scrollMap, key, { x: 0, y: 0 }); diff --git a/app/locations/router-scroll.js b/app/locations/router-scroll.js index be89f752..d91754ef 100644 --- a/app/locations/router-scroll.js +++ b/app/locations/router-scroll.js @@ -1,2 +1 @@ -/* eslint-disable */ export { default } from 'ember-router-scroll/locations/router-scroll'; diff --git a/app/services/router-scroll.js b/app/services/router-scroll.js index 44908995..e9b41794 100644 --- a/app/services/router-scroll.js +++ b/app/services/router-scroll.js @@ -1,2 +1 @@ -/* eslint-disable */ export { default } from 'ember-router-scroll/services/router-scroll';