File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -285,11 +285,14 @@ function navigateURL(arg: Controls & Samples, isInteracted: boolean): void {
285285 }
286286}
287287function loadTheme ( theme : string ) : void {
288- let doc : HTMLFormElement = < HTMLFormElement > document . getElementById ( 'themelink' ) ;
289- selectedTheme = theme ;
290- doc . href = 'styles/' + selectedTheme + '.css' ;
291- select ( '#themeswitcher-icon' ) . setAttribute ( 'src' , 'styles/images/sb_icons/SB_Switcher_icon_' + theme + '.png' ) ;
292- document . getElementById ( theme ) . style . background = '#DEDFE0' ;
288+ let ajax : Ajax = new Ajax ( './styles/' + theme + '.css' , 'GET' , true ) ;
289+ ajax . send ( ) . then ( ( result : any ) => {
290+ let doc : HTMLFormElement = < HTMLFormElement > document . getElementById ( 'themelink' ) ;
291+ selectedTheme = theme ;
292+ doc . href = 'styles/' + selectedTheme + '.css' ;
293+ select ( '#themeswitcher-icon' ) . setAttribute ( 'src' , 'styles/images/sb_icons/SB_Switcher_icon_' + theme + '.png' ) ;
294+ document . getElementById ( theme ) . style . background = '#DEDFE0' ;
295+ } ) ;
293296}
294297function addRoutes ( samplesList : Controls [ ] ) : void {
295298 for ( let node of samplesList ) {
You can’t perform that action at this time.
0 commit comments