File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -493,33 +493,16 @@ export default class Editor {
493493 this . editor . setOption ( 'theme' , cookieTheme )
494494 }
495495
496- var themeToggle = this . statusTheme . find ( '.ui-theme-toggle' )
497-
498- const checkTheme = ( ) => {
499- var theme = this . editor . getOption ( 'theme' )
500- if ( theme === 'one-dark' ) {
501- themeToggle . removeClass ( 'active' )
502- } else {
503- themeToggle . addClass ( 'active' )
504- }
505- }
506-
507- themeToggle . click ( ( ) => {
508- var theme = this . editor . getOption ( 'theme' )
509- if ( theme === 'one-dark' ) {
510- theme = 'default'
511- } else {
512- theme = 'one-dark'
513- }
496+ const setTheme = theme => {
514497 this . editor . setOption ( 'theme' , theme )
515498 Cookies . set ( 'theme' , theme , {
516499 expires : 365
517500 } )
501+ }
518502
519- checkTheme ( )
503+ this . statusIndicators . find ( '.status-theme li' ) . click ( function ( ) {
504+ setTheme ( $ ( this ) . attr ( 'value' ) )
520505 } )
521-
522- checkTheme ( )
523506 }
524507
525508 setSpellcheck ( ) {
Original file line number Diff line number Diff line change 3131 < div class ="indent-width-label " title ="Click to change indentation size "> 4</ div >
3232 < input class ="indent-width-input hidden " type ="number " min ="1 " max ="10 " maxlength ="2 " size ="2 ">
3333 </ div >
34- < div class ="status-theme ">
35- < a class ="ui-theme-toggle " title ="Toggle editor theme "> < i class ="fa fa-sun-o fa-fw "> </ i > </ a >
34+ < div class ="status-theme dropup pull-right ">
35+ < a id ="themeLabel " class ="ui-theme-label text-uppercase " data-toggle ="dropdown " role ="button " aria-haspopup ="true " aria-expanded ="false " title ="Select theme ">
36+ < i class ="fa fa-paint-brush fa-fw "> </ i >
37+ </ a >
38+ < ul class ="dropdown-menu " aria-labelledby ="themeLabel ">
39+ < li value ="one-dark "> < a > One Dark</ a > </ li >
40+ < li value ="default "> < a > Default</ a > </ li >
41+ < li value ="monokai "> < a > Monokai</ a > </ li >
42+ </ ul >
3643 </ div >
3744 < div class ="status-spellcheck ">
3845 < a class ="ui-spellcheck-toggle " title ="Toggle spellcheck "> < i class ="fa fa-check fa-fw "> </ i > </ a >
You can’t perform that action at this time.
0 commit comments