clear and disable editor while fetching contents (#603)

* clear and disable editor while fetching contents

* semicolon

Co-Authored-By: Otto Winter <otto@otto-winter.com>

* semicolon

Co-Authored-By: Otto Winter <otto@otto-winter.com>
This commit is contained in:
gitolicious 2019-06-03 22:47:35 +02:00 committed by Otto Winter
parent 30a542e763
commit 0a21816a5a

View File

@ -709,9 +709,12 @@ document.querySelectorAll(".action-edit").forEach((btn) => {
editorUploadButton.setAttribute('data-node', activeEditorConfig);
filenameField.innerHTML = activeEditorConfig;
editor.setValue("Loading configuration yaml...");
editor.setOption('readOnly', true);
fetch(`./edit?configuration=${activeEditorConfig}`, {credentials: "same-origin"})
.then(res => res.text()).then(response => {
editor.setValue(response, -1);
editor.setOption('readOnly', false);
});
modalInstance.open();