Skip to content

Commit 265a2e8

Browse files
rajakvklocks
authored andcommitted
Rewrite logic as per latest syntax -@locks review
1 parent ae946b7 commit 265a2e8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/components/ember-anchor.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable ember/classic-decorator-no-classic-methods */
12
import AnchorComponent from 'ember-anchor/components/ember-anchor';
23
import config from 'ember-api-docs/config/environment';
34
import getOffset from 'ember-api-docs/utils/get-offset';
@@ -6,7 +7,7 @@ export default class EmberAnchor extends AnchorComponent {
67
// This overrides Ember Anchor to support scrolling within a fixed position element
78
_scrollToElemPosition() {
89
let qp = this.anchorQueryParam;
9-
let qpVal = this[this['attrs.a'] ? 'a' : `controller.${qp}`];
10+
let qpVal = this.a ?? this.controller[qp];
1011
let elem = document.querySelector(`[data-${qp}="${qpVal}"]`);
1112

1213
if (elem && elem.offsetHeight) {

0 commit comments

Comments
 (0)