diff --git a/app/javascript/alchemy_admin/components/element_editor.js b/app/javascript/alchemy_admin/components/element_editor.js index 433b3e08a2..d3bb5627bc 100644 --- a/app/javascript/alchemy_admin/components/element_editor.js +++ b/app/javascript/alchemy_admin/components/element_editor.js @@ -121,6 +121,7 @@ export class ElementEditor extends HTMLElement { this.setClean() // Reset errors that might be visible from last save attempt this.errorsDisplay.innerHTML = "" + this.elementErrors.classList.add("hidden") this.body .querySelectorAll(".ingredient-editor") .forEach((el) => el.classList.remove("validation_failed")) diff --git a/app/javascript/alchemy_admin/components/uploader.js b/app/javascript/alchemy_admin/components/uploader.js index debc4686a8..3b15be7c4d 100644 --- a/app/javascript/alchemy_admin/components/uploader.js +++ b/app/javascript/alchemy_admin/components/uploader.js @@ -112,9 +112,6 @@ export class Uploader extends AlchemyHTMLElement { } this.uploadProgress = new Progress(fileUploads) this.uploadProgress.onComplete = (status) => { - if (status === "successful" || status === "canceled") { - this.uploadProgress.visible = false - } this.dispatchCustomEvent(`upload.${status}`) } diff --git a/app/javascript/alchemy_admin/components/uploader/progress.js b/app/javascript/alchemy_admin/components/uploader/progress.js index adc790c852..3e80e06e57 100644 --- a/app/javascript/alchemy_admin/components/uploader/progress.js +++ b/app/javascript/alchemy_admin/components/uploader/progress.js @@ -27,7 +27,6 @@ export class Progress extends AlchemyHTMLElement { this.actionButton.addEventListener("click", () => { if (this.finished) { this.onComplete(this.status) - this.visible = false } else { this.cancel() } @@ -126,6 +125,7 @@ export class Progress extends AlchemyHTMLElement { */ _updateView() { const status = this.status + this.className = status // update progress bar this.progressElement.value = this.totalProgress @@ -143,10 +143,9 @@ export class Progress extends AlchemyHTMLElement { if (this.finished) { this._setupCloseButton() this.onComplete(status) + } else { + this.visible = true } - - this.className = status - this.visible = true } /** diff --git a/app/views/alchemy/admin/pages/_page_status.html.erb b/app/views/alchemy/admin/pages/_page_status.html.erb index 4c2b68005f..738d11f8de 100644 --- a/app/views/alchemy/admin/pages/_page_status.html.erb +++ b/app/views/alchemy/admin/pages/_page_status.html.erb @@ -1,8 +1,8 @@ <% if page.public? %> - <%= render_icon(:cloud, size: "1x", class: "disabled") %> + <%= render_icon(:cloud, size: "1x") %> <% else %> - <%= render_icon("cloud-off", size: "1x") %> + <%= render_icon("cloud-off", size: "1x", class: "disabled") %> <% end %> diff --git a/app/views/alchemy/admin/uploader/_button.html.erb b/app/views/alchemy/admin/uploader/_button.html.erb index 47176738c8..82b458b768 100644 --- a/app/views/alchemy/admin/uploader/_button.html.erb +++ b/app/views/alchemy/admin/uploader/_button.html.erb @@ -17,9 +17,10 @@