diff --git a/assets/index.js b/assets/index.js index 24883a0..bb3a5da 100644 --- a/assets/index.js +++ b/assets/index.js @@ -603,9 +603,11 @@ async function setupEditorPage() { }); }); - const $saveBtn = document.querySelector(".save-btn"); - $saveBtn.classList.remove("hidden"); - $saveBtn.addEventListener("click", saveChange); + if (DATA.editable) { + const $saveBtn = document.querySelector(".save-btn"); + $saveBtn.classList.remove("hidden"); + $saveBtn.addEventListener("click", saveChange); + } } else if (DATA.kind == "View") { $editor.readonly = true; }