File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
tutorindigo/templates/indigo/lms/templates Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 3333 let primaryColor = "${settings.COLORS['primary']}" ;
3434 let discoveryUrl = "${settings.MKTG_URLS['ROOT']}" + "/wp-json/edly-wp-routes/footer" ;
3535
36+ const scrollToTop = ( ) => {
37+ window . scrollTo ( { top : 0 , behavior : 'smooth' } ) ;
38+ } ;
39+
3640 fetch ( discoveryUrl , {
3741 method : 'GET' ,
3842 credentials : 'include' ,
5256 ADD_ATTR : [ 'target' , 'class' ] ,
5357 } ) ;
5458 $ ( '#footer-container' ) . html ( cleanHtml ) ;
55-
59+ $ ( '#scrollToTop' ) . on ( 'click' , scrollToTop ) ;
60+ $ ( '#scrollToTop' ) . hide ( ) ;
5661 } )
5762 . catch ( error => {
5863 console . error ( 'Error:' , error ) ;
6570 primaryColor
6671 ) ;
6772 }
68-
69- const scrollToTop = ( ) => {
70- window . scrollTo ( { top : 0 , behavior : 'smooth' } ) ;
71- } ;
7273 $ ( window ) . on ( 'scroll' , function ( ) {
7374 if ( $ ( this ) . scrollTop ( ) > 200 ) {
7475 $ ( '#scrollToTop' ) . fadeIn ( ) ;
7576 } else {
7677 $ ( '#scrollToTop' ) . fadeOut ( ) ;
7778 }
7879 } ) ;
79-
8080
8181
8282 // Main function start here
83- $ ( '#scrollToTop' ) . on ( 'click' , scrollToTop ) ;
84- $ ( '#scrollToTop' ) . hide ( ) ;
8583 updatePrimaryColor ( ) ;
8684 } )
8785</ script >
You can’t perform that action at this time.
0 commit comments