mirror of
https://github.com/google/blockly.git
synced 2026-01-10 18:37:09 +01:00
Adding a iframe wrapper around the playground. (#1634)
This commit is contained in:
committed by
GitHub
parent
d9a7f84b98
commit
4092a644d5
39
tests/playgrounds/iframe.html
Normal file
39
tests/playgrounds/iframe.html
Normal file
@@ -0,0 +1,39 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Blockly <iframe> Playground</title>
|
||||
<style>
|
||||
html, body {
|
||||
border: 0;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-family: sans-serif;
|
||||
}
|
||||
h1#title {
|
||||
border: 0;
|
||||
margin: 2px;
|
||||
padding: 0;
|
||||
width: %100;
|
||||
}
|
||||
#playground-iframe {
|
||||
border: 0;
|
||||
width: %100;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var onWindowResize = function() {
|
||||
var iframe = document.getElementById('playground-iframe');
|
||||
var top = iframe.getBoundingClientRect().top;
|
||||
iframe.height = window.innerHeight - top;
|
||||
iframe.width = window.innerWidth;
|
||||
};
|
||||
window.addEventListener("resize", onWindowResize);
|
||||
window.addEventListener("load", onWindowResize);
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 id="title">Outer Frame</h1>
|
||||
<iframe id="playground-iframe" src="../playground.html">
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user