File tree Expand file tree Collapse file tree 3 files changed +20
-6
lines changed
routes/project-version/namespaces
templates/project-version/classes Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Original file line number Diff line number Diff line change 1
1
import Mixin from '@ember/object/mixin' ;
2
2
import { inject as service } from '@ember/service' ;
3
+ import $ from 'jquery' ;
4
+ import config from 'ember-api-docs/config/environment' ;
3
5
4
6
export default Mixin . create ( {
5
7
@@ -11,7 +13,17 @@ export default Mixin.create({
11
13
} ,
12
14
13
15
didTransition ( ) {
14
- this . get ( 'scrollPositionReset' ) . doReset ( ) ;
16
+ this . _super ( ) ;
17
+ if ( ( typeof FastBoot === 'undefined' ) && this . get ( 'controller.anchor' ) === '' ) {
18
+ let elem = $ ( '#methods' ) ;
19
+ let offset = ( elem && elem . offset && elem . offset ( ) ) ? elem . offset ( ) . top : null ;
20
+ if ( offset ) {
21
+ const navMenuHeight = $ ( 'header' ) . outerHeight ( ) ;
22
+ $ ( config . APP . scrollContainerSelector ) . scrollTop ( offset - navMenuHeight - 10 ) ;
23
+ }
24
+ } else {
25
+ this . get ( 'scrollPositionReset' ) . doReset ( ) ;
26
+ }
15
27
}
16
28
}
17
29
} ) ;
Original file line number Diff line number Diff line change 1
1
import ClassRoute from '../classes/class' ;
2
+ import ScrollTracker from 'ember-api-docs/mixins/scroll-tracker' ;
2
3
3
- export default ClassRoute . extend ( {
4
+ export default ClassRoute . extend ( ScrollTracker , {
4
5
templateName : 'project-version/classes/class' ,
5
6
6
7
model ( params , transition ) {
Original file line number Diff line number Diff line change 47
47
model.project.id
48
48
model.projectVersion.compactVersion
49
49
model.name
50
- (query-params anchor =" " )
50
+ (query-params anchor =undefined )
51
51
class =" tabbed-layout__menu__item"
52
52
activeClass =" tabbed-layout__menu__item_selected"
53
53
current-when = (concat parentName " .index" )
60
60
model.project.id
61
61
model.projectVersion.compactVersion
62
62
model.name
63
- (query-params anchor =" " )
63
+ (query-params anchor =undefined )
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
}}
74
75
model.project.id
75
76
model.projectVersion.compactVersion
76
77
model.name
77
- (query-params anchor =" " )
78
+ (query-params anchor =undefined )
78
79
class =" tabbed-layout__menu__item"
79
80
activeClass =" tabbed-layout__menu__item_selected"
80
81
current-when = (concat parentName " .properties" )
88
89
model.project.id
89
90
model.projectVersion.compactVersion
90
91
model.name
91
- (query-params anchor =" " )
92
+ (query-params anchor =undefined )
92
93
class =" tabbed-layout__menu__item"
93
94
activeClass =" tabbed-layout__menu__item_selected"
94
95
current-when = (concat parentName " .events" )
You can’t perform that action at this time.
0 commit comments