Skip to content

Commit

Permalink
Introduce refresh attribute for frame element
Browse files Browse the repository at this point in the history
  • Loading branch information
afcapel committed Oct 8, 2023
1 parent f5edb5e commit 3f45254
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/drive/morph_renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
18 changes: 18 additions & 0 deletions src/elements/frame_element.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down

0 comments on commit 3f45254

Please sign in to comment.