diff --git a/src/core/drive/morph_renderer.js b/src/core/drive/morph_renderer.js index 4cc10a6e8..802cb6b07 100644 --- a/src/core/drive/morph_renderer.js +++ b/src/core/drive/morph_renderer.js @@ -73,7 +73,7 @@ export class MorphRenderer extends Renderer { } #isFrameReloadedWithMorph(element) { - return element.getAttribute("src") && element.getAttribute("refresh") === "morph" + return element.src && element.refresh === "morph" } #remoteFrames() { diff --git a/src/elements/frame_element.js b/src/elements/frame_element.js index 0e2bee917..4feb36713 100644 --- a/src/elements/frame_element.js +++ b/src/elements/frame_element.js @@ -75,6 +75,24 @@ export class FrameElement extends HTMLElement { } } + /** + * Gets the refresh mode for the frame. + */ + get refresh() { + return this.getAttribute("refresh") + } + + /** + * Sets the refresh mode for the frame. + */ + set refresh(value) { + if (value) { + this.setAttribute("refresh", value) + } else { + this.removeAttribute("refresh") + } + } + /** * Determines if the element is loading */