@@ -110,6 +110,11 @@ function setAceOption(user_ace_option) {
110110 $ ( "#body-content-type option[value='" + user_ace_option + "']" ) . attr ( "selected" , "selected" ) ;
111111}
112112
113+ function setAceThemeOption ( theme_option ) {
114+ $ ( '#body-editor-theme option:selected' ) . removeAttr ( 'selected' ) ;
115+ $ ( "#body-editor-theme option[value='" + theme_option + "']" ) . attr ( "selected" , "selected" ) ;
116+ }
117+
113118$ ( function ( ) {
114119
115120 user_theme = window . localStorage . getItem ( "theme" ) ;
@@ -121,7 +126,8 @@ $(function () {
121126 body_editor . setTheme ( require ( 'ace-builds/src/theme-tomorrow_night_eighties' ) ) ;
122127 response_editor . setTheme ( require ( 'ace-builds/src/theme-tomorrow_night_eighties' ) ) ;
123128 $ ( '#theme option:selected' ) . removeAttr ( 'selected' ) ;
124- $ ( "#theme option[value='dark']" ) . attr ( "selected" , "selected" ) ;
129+ $ ( "#theme option[value='" + user_theme + "']" ) . attr ( "selected" , "selected" ) ;
130+ setAceThemeOption ( "dark" ) ;
125131 }
126132
127133
@@ -136,12 +142,14 @@ $(function () {
136142 window . localStorage . setItem ( "theme" , "dark" ) ;
137143 body_editor . setTheme ( require ( 'ace-builds/src/theme-tomorrow_night_eighties' ) ) ;
138144 response_editor . setTheme ( require ( 'ace-builds/src/theme-tomorrow_night_eighties' ) ) ;
145+ setAceThemeOption ( "dark" ) ;
139146 }
140147 else if ( theme_option == "light" ) {
141148 $ ( "#theme-link" ) . attr ( "href" , "../styles/empty.css" ) ;
142149 window . localStorage . setItem ( "theme" , "light" ) ;
143150 body_editor . setTheme ( require ( 'ace-builds/src/theme-xcode' ) ) ;
144151 response_editor . setTheme ( require ( 'ace-builds/src/theme-xcode' ) ) ;
152+ setAceThemeOption ( "light" ) ;
145153 }
146154 }
147155 } ) ;
0 commit comments