From c3fdee68a80150a04533e339841d2929e36a9ee9 Mon Sep 17 00:00:00 2001 From: ebolam Date: Tue, 19 Jul 2022 16:53:45 -0400 Subject: [PATCH] Revert "Revert "Fix for edit files"" This reverts commit 9c1fc5af8b3c432ddfe39614f36a3e079f7f596f. --- static/application.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/static/application.js b/static/application.js index 8defc342..2388aa23 100644 --- a/static/application.js +++ b/static/application.js @@ -3434,6 +3434,10 @@ function popup_breadcrumbs(data) { function popup_edit_file(data) { var popup_list = document.getElementById('popup_list'); + var accept = document.getElementById("popup_accept"); + accept.classList.add("btn-secondary"); + accept.classList.remove("btn-primary"); + accept.textContent = "Save"; //first, let's clear out our existing data while (popup_list.firstChild) { popup_list.removeChild(popup_list.firstChild); @@ -3444,6 +3448,7 @@ function popup_edit_file(data) { var textarea = document.getElementById("filecontents"); socket.emit("popup_change_file", {"file": textarea.getAttribute("filename"), "data": textarea.value}); document.getElementById("popup").classList.add("hidden"); + this.classList.add("hidden"); }; var textarea = document.createElement("textarea"); @@ -3454,7 +3459,9 @@ function popup_edit_file(data) { textarea.value = data.text; textarea.onblur = function () { var accept = document.getElementById("popup_accept"); - accept.classList.remove("disabled"); + accept.classList.remove("hidden"); + accept.classList.remove("btn-secondary"); + accept.classList.add("btn-primary"); }; popup_list.append(textarea);