Skip to content

Commit

Permalink
added iframe button to container
Browse files Browse the repository at this point in the history
SQUASHED: AUTO-COMMIT-src-components-tools-lively-container.html,AUTO-COMMIT-src-components-tools-lively-container.js,
  • Loading branch information
onsetsu committed Aug 14, 2024
1 parent fcd1879 commit d996b56
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/components/tools/lively-container.html
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@
visibility: visible;
}

:host(:not([src$=".html"])) #container-navigation #iframe {
display: none;
visibility: hidden;
}

:host(.show-options) #toggleOptions i {
}

Expand Down Expand Up @@ -260,6 +265,8 @@
<i class="fa fa-paint-brush"></i></button>
<button class="edit" id="apply" title="apply code or template">
<i class="fa fa-gears" aria-hidden="true"></i></button>
<button class="optional edit" id="iframe" title="open html in an iframe">
<i class="fa fa-html5" aria-hidden="true"></i></button>
<button class="optional edit" id="spawnTestRunner" title="spawn test runner">
<i class="fa fa-check-square-o" aria-hidden="true"></i></button>
<button class="edit" id="browse" title="open new browser for url">
Expand Down
6 changes: 6 additions & 0 deletions src/components/tools/lively-container.js
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,12 @@ export default class Container extends Morph {
}
}

async onIframe(evt) {
const url = this.getBaseURL();
const iframe = await lively.openComponentInWindow('lively-iframe', false, lively.pt(1000, 800))
iframe.setURL(url)
}

async onSpawnTestRunner(evt) {
const path = this.getPath()

Expand Down

0 comments on commit d996b56

Please sign in to comment.