From 0a21816a5ae09e3dd16caa46c6b66a349518dbb5 Mon Sep 17 00:00:00 2001 From: gitolicious Date: Mon, 3 Jun 2019 22:47:35 +0200 Subject: [PATCH] clear and disable editor while fetching contents (#603) * clear and disable editor while fetching contents * semicolon Co-Authored-By: Otto Winter * semicolon Co-Authored-By: Otto Winter --- esphome/dashboard/static/esphome.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/esphome/dashboard/static/esphome.js b/esphome/dashboard/static/esphome.js index 044c2d70a3..1cf3dde2d6 100644 --- a/esphome/dashboard/static/esphome.js +++ b/esphome/dashboard/static/esphome.js @@ -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();