File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ const sourcecontent: string = '<div class="tab-pane {2}" id="{0}" role="tabpanel
24
24
const plnk : string = '<li class="plnk" style="float:right"><a id="plnkr">Open in Plunker</a></li>' ;
25
25
const themes : string [ ] = [ 'material' , 'fabric' ] ;
26
26
let selectedTheme : string ;
27
+ let themeFlag : boolean = true ;
27
28
declare let hljs : any ;
28
29
/**
29
30
* App Controller
@@ -146,7 +147,7 @@ export class SBController {
146
147
. subscribe ( ( event : any ) => {
147
148
let hashTheme : string = location . hash . split ( '/' ) [ 1 ] ;
148
149
let theme : string = localStorage . getItem ( 'ej2-theme' ) ;
149
- if ( ! hashTheme || theme || ( selectedTheme && selectedTheme !== hashTheme ) ) {
150
+ if ( ! hashTheme || theme || ( selectedTheme && selectedTheme !== hashTheme ) || themeFlag ) {
150
151
let activeTheme : Element = select ( '.active-theme' ) ;
151
152
if ( activeTheme ) {
152
153
activeTheme . classList . remove ( 'active-theme' ) ;
@@ -482,6 +483,7 @@ function loadTheme(theme: string): void {
482
483
doc . href = './styles/' + theme + '.css' ;
483
484
select ( '#themeswitcher-icon' ) . setAttribute ( 'src' , 'styles/images/SB_icon/SB_Switcher_icon_' + theme + '.png' ) ;
484
485
document . body . classList . add ( theme ) ;
486
+ themeFlag = false ;
485
487
} ) ;
486
488
}
487
489
You can’t perform that action at this time.
0 commit comments