diff --git a/app/assets/stylesheets/alchemy/frame.scss b/app/assets/stylesheets/alchemy/frame.scss
index 9c3825f5ff..6114e36bae 100644
--- a/app/assets/stylesheets/alchemy/frame.scss
+++ b/app/assets/stylesheets/alchemy/frame.scss
@@ -1,13 +1,12 @@
-div#overlay {
+alchemy-overlay {
display: none;
position: fixed;
- left: 0px;
- top: 0px;
+ left: 0;
+ top: 0;
width: 100%;
height: 100%;
z-index: 400000;
background-color: rgba(229, 229, 229, 0.4);
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = #40E5E5E5, endColorstr = #40E5E5E5);
}
div#overlay_text_box {
diff --git a/app/javascript/alchemy_admin/components/overlay.js b/app/javascript/alchemy_admin/components/overlay.js
index cbfd58c464..1032f3b610 100644
--- a/app/javascript/alchemy_admin/components/overlay.js
+++ b/app/javascript/alchemy_admin/components/overlay.js
@@ -1,22 +1,18 @@
import { AlchemyHTMLElement } from "alchemy_admin/components/alchemy_html_element"
class Overlay extends AlchemyHTMLElement {
- static properties = {
- show: { default: false },
- text: { default: "" }
- }
-
render() {
- this.id = `overlay`
- this.style.setProperty("display", this.show ? "block" : "none")
-
return `
- ${this.text}
+ ${this.getAttribute("text")}
`
}
+
+ set show(value) {
+ this.style.setProperty("display", value ? "block" : "none")
+ }
}
customElements.define("alchemy-overlay", Overlay)
diff --git a/app/javascript/alchemy_admin/please_wait_overlay.js b/app/javascript/alchemy_admin/please_wait_overlay.js
index d483cef748..a8dd2aae77 100644
--- a/app/javascript/alchemy_admin/please_wait_overlay.js
+++ b/app/javascript/alchemy_admin/please_wait_overlay.js
@@ -1,8 +1,8 @@
/**
* To show the "Please wait" overlay.
* Pass false to hide it.
- * @param {boolean,null} show
+ * @param {boolean} show
*/
-export default function pleaseWaitOverlay(show) {
- customElements.get("alchemy-overlay").show = !!show
+export default function pleaseWaitOverlay(show = true) {
+ document.querySelector("alchemy-overlay").show = !!show
}
diff --git a/spec/features/admin/page_editing_feature_spec.rb b/spec/features/admin/page_editing_feature_spec.rb
index 78364a83b3..1a5df80b8b 100644
--- a/spec/features/admin/page_editing_feature_spec.rb
+++ b/spec/features/admin/page_editing_feature_spec.rb
@@ -258,7 +258,6 @@
it "is not possible to edit the attribute", :aggregate_failures do
visit alchemy.configure_admin_page_path(readonly_page)
- puts page.body
readonly_page.fixed_attributes.all.each do |attribute, _v|
expect(page).to have_selector("#page_#{attribute}[disabled]")
end
diff --git a/spec/javascript/alchemy_admin/components/overlay.spec.js b/spec/javascript/alchemy_admin/components/overlay.spec.js
index 64463c7587..cecb41fe52 100644
--- a/spec/javascript/alchemy_admin/components/overlay.spec.js
+++ b/spec/javascript/alchemy_admin/components/overlay.spec.js
@@ -20,6 +20,7 @@ describe("alchemy-overlay", () => {
it("should be hidden", () => {
renderComponent()
+ overlay.show = false
expect(overlay.style.getPropertyValue("display")).toBe("none")
})
@@ -29,7 +30,8 @@ describe("alchemy-overlay", () => {
})
it("should be visible", () => {
- renderComponent(``)
+ renderComponent()
+ overlay.show = true
expect(overlay.style.getPropertyValue("display")).toBe("block")
})
})