File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -78,10 +78,21 @@ async function onEditContent(event) {
78
78
79
79
comboMarkdownEditor = getComboMarkdownEditor ( editContentZone . querySelector ( '.combo-markdown-editor' ) ) ;
80
80
if ( ! comboMarkdownEditor ) {
81
+ const opts = { } ;
82
+ opts . onContentChanged = ( editor ) => {
83
+ const saveButton = editContentZone . querySelector ( '.ui.primary.button' ) ;
84
+ const isUploading = editor . isUploading ( ) ;
85
+ if ( saveButton ) {
86
+ saveButton . disabled = isUploading ;
87
+ }
88
+ } ;
89
+
81
90
editContentZone . innerHTML = document . querySelector ( '#issue-comment-editor-template' ) . innerHTML ;
82
- comboMarkdownEditor = await initComboMarkdownEditor ( editContentZone . querySelector ( '.combo-markdown-editor' ) ) ;
91
+ comboMarkdownEditor = await initComboMarkdownEditor ( editContentZone . querySelector ( '.combo-markdown-editor' ) , opts ) ;
92
+
83
93
editContentZone . querySelector ( '.ui.cancel.button' ) . addEventListener ( 'click' , cancelAndReset ) ;
84
94
editContentZone . querySelector ( '.ui.primary.button' ) . addEventListener ( 'click' , saveAndRefresh ) ;
95
+ opts . onContentChanged ( comboMarkdownEditor ) ;
85
96
}
86
97
87
98
// Show write/preview tab and copy raw content as needed
You can’t perform that action at this time.
0 commit comments