Skip to content

Commit

Permalink
feat(frame-manager): add attribute that sets the id of the iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanstith15 committed Nov 14, 2022
1 parent efc7467 commit 226f550
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/iframe-coordinator-cli/src/views/IframeEmbed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<frame-router
id="frameRouter"
v-bind:route="frameRoute"
frame-id="ifc-cli-frame"
v-on:notifyRequest="displayToast"
v-on:registeredKeyFired="handleKeyEvent"
v-on:navRequest="handleNav"
Expand Down
4 changes: 4 additions & 0 deletions packages/iframe-coordinator/src/FrameManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,10 @@ to bad data passed to a frame-router method.
* @param parent The element to place the iframe inside.
*/
public embed(parent: HTMLElement) {
const frameId = parent.getAttribute('frame-id');
if (frameId) {
this._iframe.setAttribute('id', frameId);
}
parent.appendChild(this._iframe);
}

Expand Down

0 comments on commit 226f550

Please sign in to comment.