File tree Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Expand file tree Collapse file tree 2 files changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -45,12 +45,12 @@ export default Component.extend(Notifier, {
45
45
didInsertElement ( ) {
46
46
this . _super ( ...arguments ) ;
47
47
48
- this . jumpToSection ( this . get ( 'currentPageId' ) ) ;
49
48
} ,
50
49
51
50
didRender ( ) {
52
51
this . _super ( ...arguments ) ;
53
52
53
+ this . jumpToSection ( this . get ( 'currentPageId' ) ) ;
54
54
this . contentLinkHandler ( ) ;
55
55
} ,
56
56
Original file line number Diff line number Diff line change 11
11
12
12
import $ from 'jquery' ;
13
13
import Service , { inject as service } from '@ember/service' ;
14
- import { schedule } from '@ember/runloop' ;
15
14
16
15
export default Service . extend ( {
17
16
sessionService : service ( 'session' ) ,
@@ -42,15 +41,17 @@ export default Service.extend({
42
41
} ,
43
42
44
43
scrollTo ( id ) {
45
- schedule ( 'afterRender' , ( ) => {
46
- let elem = $ ( id ) . offset ( ) ;
47
- if ( _ . isUndefined ( elem ) ) return ;
44
+ let elem = $ ( id ) . offset ( ) ;
45
+ if ( _ . isUndefined ( elem ) ) return ;
48
46
49
- $ ( 'html, body' ) . animate ( {
50
- scrollTop : elem . top
51
- } , 250 ) ;
52
- } ) ;
53
- } ,
47
+ $ ( 'html, body' ) . animate ( {
48
+ scrollTop : elem . top
49
+ } , 250 ) ;
50
+ } ,
51
+
52
+ waitScrollTo ( id ) {
53
+ setTimeout ( ( ) => { this . scrollTo ( id ) ; } , 1000 ) ;
54
+ } ,
54
55
55
56
downloadFile ( content , filename ) {
56
57
let b = new Blob ( [ content ] , { type : 'text/html' } ) ;
You can’t perform that action at this time.
0 commit comments