File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change @@ -18,23 +18,39 @@ module.exports = ext.register("ext/themes/themes", {
1818 offline : false ,
1919 type : ext . GENERAL ,
2020 nodes : [ ] ,
21+ currTheme : "" ,
22+ saved : false ,
2123
2224 register : function ( themes ) {
25+ var _self = this ;
26+
2327 for ( var name in themes ) {
2428 this . nodes . push (
2529 mnuThemes . appendChild ( new apf . item ( {
2630 caption : name ,
27- type : "radio" ,
28- value : themes [ name ]
31+ type : "item" ,
32+ value : themes [ name ] ,
33+ onmouseover : function ( e ) {
34+ _self . currTheme = settings . model . queryValue ( "editors/code/@theme" ) ;
35+ settings . model . setQueryValue ( "editors/code/@theme" , this . value ) ;
36+ _self . saved = false ;
37+ } ,
38+ onmouseout : function ( e ) {
39+ if ( ! _self . saved ) {
40+ settings . model . setQueryValue ( "editors/code/@theme" , _self . currTheme ) ;
41+ _self . saved = false ;
42+ }
43+ }
2944 } ) )
3045 ) ;
3146 }
3247 } ,
3348
34- set : function ( path ) {
49+ set : function ( path , dispatch ) {
3550 //Save theme settings
3651 settings . model . setQueryValue ( "editors/code/@theme" , path ) ;
3752 settings . save ( ) ;
53+ this . saved = true ;
3854 ide . dispatchEvent ( "track_action" , { type : "theme change" , theme : path } ) ;
3955 } ,
4056
@@ -54,7 +70,7 @@ module.exports = ext.register("ext/themes/themes", {
5470 } ) )
5571 ) ;
5672 } ,
57-
73+
5874 enable : function ( ) {
5975 } ,
6076
You can’t perform that action at this time.
0 commit comments