File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
public/app/features/styleguide Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ class StyleGuideCtrl {
13
13
pages = [ 'colors' , 'buttons' ] ;
14
14
15
15
/** @ngInject **/
16
- constructor ( private $http , $routeParams ) {
16
+ constructor ( private $http , private $routeParams , private $location ) {
17
17
this . theme = config . bootData . user . lightTheme ? 'light' : 'dark' ;
18
18
this . page = { } ;
19
19
@@ -37,8 +37,11 @@ class StyleGuideCtrl {
37
37
}
38
38
39
39
switchTheme ( ) {
40
- var other = this . theme === 'dark' ? 'light' : 'dark' ;
41
- window . location . href = window . location . href + '?theme=' + other ;
40
+ this . $routeParams . theme = this . theme === 'dark' ? 'light' : 'dark' ;
41
+ this . $location . search ( this . $routeParams ) ;
42
+ setTimeout ( ( ) => {
43
+ window . location . href = window . location . href ;
44
+ } ) ;
42
45
}
43
46
44
47
}
You can’t perform that action at this time.
0 commit comments