File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
routes/project-version/namespaces/namespace
templates/project-version/classes Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 1
1
import Route from '@ember/routing/route' ;
2
+ import { isEmpty } from '@ember/utils' ;
3
+ import $ from 'jquery' ;
4
+ import config from 'ember-api-docs/config/environment' ;
2
5
3
6
export default Route . extend ( {
4
- templateName : 'methods'
7
+ templateName : 'methods' ,
8
+ actions : {
9
+ didTransition ( ) {
10
+ this . _super ( ) ;
11
+ if ( ( typeof FastBoot === 'undefined' ) && isEmpty ( this . get ( 'controller.anchor' ) ) ) {
12
+ let elem = $ ( '#methods' ) ;
13
+ let offset = ( elem && elem . offset && elem . offset ( ) ) ? elem . offset ( ) . top : null ;
14
+ if ( offset ) {
15
+ const navMenuHeight = $ ( 'header' ) . outerHeight ( ) ;
16
+ $ ( config . APP . scrollContainerElement ) . scrollTop ( offset - navMenuHeight - 10 ) ;
17
+ }
18
+ }
19
+ }
20
+ }
5
21
} ) ;
Original file line number Diff line number Diff line change 63
63
(query-params anchor =" " )
64
64
class =" tabbed-layout__menu__item"
65
65
activeClass =" tabbed-layout__menu__item_selected"
66
+ id =" methods"
66
67
current-when = (concat parentName " .methods" )
67
68
data-test-tab =" methods"
68
69
}}
You can’t perform that action at this time.
0 commit comments