Skip to content

Commit 0a116c6

Browse files
committed
disable modify button on image uploading
1 parent 9f76552 commit 0a116c6

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

web_src/js/features/repo-issue-edit.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,10 +78,21 @@ async function onEditContent(event) {
7878

7979
comboMarkdownEditor = getComboMarkdownEditor(editContentZone.querySelector('.combo-markdown-editor'));
8080
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+
8190
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+
8393
editContentZone.querySelector('.ui.cancel.button').addEventListener('click', cancelAndReset);
8494
editContentZone.querySelector('.ui.primary.button').addEventListener('click', saveAndRefresh);
95+
opts.onContentChanged(comboMarkdownEditor);
8596
}
8697

8798
// Show write/preview tab and copy raw content as needed

0 commit comments

Comments
 (0)