File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -1184,11 +1184,9 @@ async function initRepository() {
1184
1184
// Change status
1185
1185
const $statusButton = $ ( '#status-button' ) ;
1186
1186
$ ( '#comment-form textarea' ) . on ( 'keyup' , function ( ) {
1187
- if ( $ ( this ) . val ( ) . length === 0 ) {
1188
- $statusButton . text ( $statusButton . data ( 'status' ) ) ;
1189
- } else {
1190
- $statusButton . text ( $statusButton . data ( 'status-and-comment' ) ) ;
1191
- }
1187
+ const $simplemde = $ ( this ) . data ( 'simplemde' ) ;
1188
+ const value = ( $simplemde && $simplemde . value ( ) ) ? $simplemde . value ( ) : $ ( this ) . val ( ) ;
1189
+ $statusButton . text ( $statusButton . data ( value . length === 0 ? 'status' : 'status-and-comment' ) ) ;
1192
1190
} ) ;
1193
1191
$statusButton . on ( 'click' , ( ) => {
1194
1192
$ ( '#status' ) . val ( $statusButton . data ( 'status-val' ) ) ;
@@ -1698,6 +1696,8 @@ function setCommentSimpleMDE($editArea) {
1698
1696
}
1699
1697
} ) ;
1700
1698
attachTribute ( simplemde . codemirror . getInputField ( ) , { mentions : true , emoji : true } ) ;
1699
+ $editArea . data ( 'simplemde' , simplemde ) ;
1700
+ $ ( simplemde . codemirror . getInputField ( ) ) . data ( 'simplemde' , simplemde ) ;
1701
1701
return simplemde ;
1702
1702
}
1703
1703
You can’t perform that action at this time.
0 commit comments