@@ -126,7 +126,7 @@ define([
126
126
var page = new com_String ( ) ;
127
127
page . appendLine ( '<div class="vp-divide-top">' ) ;
128
128
page . appendLine ( this . templateForToolbar ( ) ) ;
129
- page . appendFormatLine ( '<textarea id="{0}">{1}</textarea>' , 'vp_markdownEditor' , this . state . editor ) ;
129
+ page . appendFormatLine ( '<textarea id="{0}" class="vp-state" >{1}</textarea>' , 'vp_markdownEditor' , this . state . editor ) ;
130
130
page . appendFormatLine ( '<div id="{0}"></div>' , "vp_attachEncodedDataArea" ) ;
131
131
page . appendLine ( '</div>' ) ;
132
132
page . appendFormatLine ( '<div id="{0}" class="vp-divide-bot">{1}</div>' , 'vp_markdownPreview' , this . state . preview ) ;
@@ -148,10 +148,6 @@ define([
148
148
</div>` ;
149
149
}
150
150
151
- templateForDataView ( ) {
152
- return `<textarea id="vp_markdownPreview"></textarea>` ;
153
- }
154
-
155
151
render ( ) {
156
152
super . render ( ) ;
157
153
@@ -213,14 +209,9 @@ define([
213
209
preview = '' ;
214
210
}
215
211
that . state . preview = preview ;
216
- document . getElementById ( " vp_markdownPreview") . innerHTML = preview ;
212
+ $ ( that . wrapSelector ( "# vp_markdownPreview") ) . html ( preview ) ;
217
213
218
214
MathJax . Hub . Queue ( [ "Typeset" , MathJax . Hub , "vp_markdownPreview" ] ) ;
219
-
220
- // re render block
221
- if ( block ) {
222
- block . render ( ) ;
223
- }
224
215
} ) ;
225
216
}
226
217
@@ -306,6 +297,7 @@ define([
306
297
// repace selection
307
298
cm . replaceSelection ( adjustText ) ;
308
299
// TODO: set block code
300
+ cm . focus ( ) ;
309
301
}
310
302
311
303
/**
0 commit comments