Skip to content

Commit 9a7b385

Browse files
committed
Rewrite logic as per latest syntax -@locks review
1 parent 8a39a37 commit 9a7b385

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/components/ember-anchor.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable ember/classic-decorator-no-classic-methods */
2+
import { get } from '@ember/object';
13
import AnchorComponent from 'ember-anchor/components/ember-anchor';
24
import config from 'ember-api-docs/config/environment';
35
import getOffset from 'ember-api-docs/utils/get-offset';
@@ -6,7 +8,7 @@ export default class EmberAnchor extends AnchorComponent {
68
// This overrides Ember Anchor to support scrolling within a fixed position element
79
_scrollToElemPosition() {
810
let qp = this.anchorQueryParam;
9-
let qpVal = this[this['attrs.a'] ? 'a' : `controller.${qp}`];
11+
let qpVal = this.a ?? this.controller[qp];
1012
let elem = document.querySelector(`[data-${qp}="${qpVal}"]`);
1113

1214
if (elem && elem.offsetHeight) {

0 commit comments

Comments
 (0)