File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -86,12 +86,14 @@ export default class RegExr extends EventDispatcher {
86
86
87
87
// getter / setters:
88
88
get state ( ) {
89
+ console . log ( this . text . mode ) ;
89
90
let o = {
90
91
expression : this . expression . value ,
91
92
text : this . text . value ,
92
93
tests : this . text . tests ,
93
94
flavor : this . flavor . value ,
94
- tool : this . tools . value
95
+ tool : this . tools . value ,
96
+ mode : this . text . mode ,
95
97
} ;
96
98
// copy share values onto the pattern object:
97
99
return Utils . copy ( this . share . value , o ) ;
@@ -103,6 +105,7 @@ export default class RegExr extends EventDispatcher {
103
105
this . expression . value = o . expression ;
104
106
this . text . value = o . text ;
105
107
this . text . tests = o . tests ;
108
+ this . text . mode = o . mode ;
106
109
this . tools . value = o . tool ;
107
110
this . share . pattern = o ;
108
111
this . resetUnsaved ( ) ;
Original file line number Diff line number Diff line change @@ -101,6 +101,7 @@ export default class Server {
101
101
o . rating = Number ( o . rating ) ;
102
102
o . userRating = Number ( o . userRating ) ;
103
103
o . flavor = o . flavor || "js" ;
104
+ o . mode = o . mode || "text" ;
104
105
o . text = o . text || null ;
105
106
if ( o . tool && o . tool . id ) { o . tool . id = o . tool . id . toLowerCase ( ) ; }
106
107
}
Original file line number Diff line number Diff line change @@ -68,8 +68,9 @@ export default class Text extends EventDispatcher {
68
68
}
69
69
70
70
set mode ( val ) {
71
- this . modeList . selected = val ;
72
- this . _updateMode ( ) ;
71
+ if ( val === this . mode ) { return ; }
72
+ this . modeList . selected = val || "text" ;
73
+ this . _handleModeChange ( ) ;
73
74
}
74
75
75
76
get mode ( ) {
You can’t perform that action at this time.
0 commit comments