Skip to content

Commit

Permalink
added update button to iframe
Browse files Browse the repository at this point in the history
SQUASHED: AUTO-COMMIT-src-components-widgets-lively-iframe.html,AUTO-COMMIT-src-components-widgets-lively-iframe.js,
  • Loading branch information
onsetsu committed Aug 15, 2024
1 parent 8591ede commit 0f19fc0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/components/widgets/lively-iframe.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<template id="lively-iframe" data-title="iFrame Browser" >
<style data-src="/templates/livelystyle.css"></style>
<style data-src="/src/external/font-awesome/css/font-awesome.css"></style>
<style>
:host {
width: 1980px;
Expand Down Expand Up @@ -32,11 +33,22 @@
:host([navigation=false]) input {
display: none
}


button {
height: 1.5em;
vertical-align: center;
}
#menubar {
justify-items: center;
align-items: middle;
}

</style>
<div class="container">
<div id="menubar">
<button id='update-button'>
<i class='fa fa-refresh' aria-hidden='true'></i>
</button>
<input id="input" value="" />
</div>
<iframe id="frame" width="100%" height="100%">
Expand Down
5 changes: 5 additions & 0 deletions src/components/widgets/lively-iframe.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export default class LivelyIFrame extends Morph {
async initialize() {
this.windowTitle = "iFrame Browser";
this.input.onchange = () => this.update();
lively.html.registerButtons(this)

if (this.getAttribute("src")) {
this.setURL(this.getAttribute("src"));
Expand Down Expand Up @@ -49,6 +50,10 @@ export default class LivelyIFrame extends Morph {
this.get("#menubar").hidden = false;
}

onUpdateButton() {
this.update()
}

livelyMigrate(other) {
this.setURL(other.getURL());
}
Expand Down

0 comments on commit 0f19fc0

Please sign in to comment.