File tree Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Expand file tree Collapse file tree 2 files changed +7
-10
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,9 @@ export default AnchorComponent.extend({
10
10
let qp = this . get ( 'anchorQueryParam' ) ;
11
11
let qpVal = this . get ( get ( this , 'attrs.a' ) ? 'a' : `controller.${ qp } ` ) ;
12
12
let elem = $ ( `[data-${ qp } ="${ qpVal } "]` ) ;
13
- let offset = ( elem && elem . offset && elem . offset ( ) ) ? elem . offset ( ) . top : null ;
13
+ let offset = elem . offset ( ) ? elem . offset ( ) . top : 0 ;
14
14
if ( offset ) {
15
- const navMenuHeight = $ ( 'header' ) . outerHeight ( ) ;
16
- $ ( config . APP . scrollContainerSelector ) . scrollTop ( offset - navMenuHeight - 10 ) ;
15
+ $ ( config . APP . scrollContainerSelector ) . scrollTop ( offset ) ;
17
16
}
18
17
}
19
18
} ) ;
Original file line number Diff line number Diff line change @@ -14,17 +14,15 @@ export default Mixin.create({
14
14
15
15
didTransition ( ) {
16
16
this . _super ( ) ;
17
- let isAnchorEmpty = window && window . location && window . location . search === '?anchor='
18
- if ( ( typeof FastBoot === 'undefined' ) && isAnchorEmpty ) {
17
+ if ( ( typeof FastBoot === 'undefined' ) && window . location . search === '?anchor=' ) {
19
18
let elem = $ ( '#methods' ) ;
20
- let offset = ( elem && elem . offset && elem . offset ( ) ) ? elem . offset ( ) . top : null ;
19
+ let offset = elem . offset ( ) ? elem . offset ( ) . top : 0 ;
21
20
if ( offset ) {
22
- const navMenuHeight = $ ( 'header' ) . outerHeight ( ) ;
23
- $ ( config . APP . scrollContainerSelector ) . scrollTop ( offset - navMenuHeight - 10 ) ;
21
+ $ ( config . APP . scrollContainerSelector ) . scrollTop ( offset - 10 ) ;
22
+ return ;
24
23
}
25
- } else {
26
- this . get ( 'scrollPositionReset' ) . doReset ( ) ;
27
24
}
25
+ this . get ( 'scrollPositionReset' ) . doReset ( ) ;
28
26
}
29
27
}
30
28
} ) ;
You can’t perform that action at this time.
0 commit comments