Browse Source

Working resize

Signed-off-by: falkTX <falktx@falktx.com>
pull/19/head
falkTX 3 years ago
parent
commit
f46058f187
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 12 additions and 6 deletions
  1. +1
    -0
      .htaccess
  2. +11
    -6
      Board.php

+ 1
- 0
.htaccess View File

@@ -14,6 +14,7 @@ Redirect 301 /carla https://kx.studio/Applications:Carla
Redirect 301 /carla-control https://kx.studio/Applications:Carla-Control

Redirect 301 /applications https://kx.studio/Applications
Redirect 301 /board https://kx.studio/Board
Redirect 301 /documentation https://kx.studio/Documentation
Redirect 301 /donations https://kx.studio/Donations
Redirect 301 /downloads https://kx.studio/Downloads


+ 11
- 6
Board.php View File

@@ -7,12 +7,17 @@ include_once("includes/header.php");
?>

<script type="text/javascript">
function resizeIframe()
{
document.domain = board.kx.studio;
function resizeIframe() {
var board = document.getElementById("iframe-board");
var height = board.contentWindow.document.body.scrollHeight;
board.style.height = height;

window.addEventListener("message", function(event) {
if (event.origin !== "https://board.kx.studio")
return;
var height = parseInt(event.data);
board.style.height = height + "px";
}, false);

board.contentWindow.postMessage("hi", "https://board.kx.studio/");
}
</script>
<noscript>
@@ -25,7 +30,7 @@ function resizeIframe()
<iframe
id="iframe-board"
src="https://board.kx.studio/public/board/f062a2b1cf34806109a3936a9373b8f044f0e0ab4ede4f1e2bf76195af27"
style="display:block;width:100%;min-height:300px;height:calc(100% - 30px);border:none;padding:0;margin:0;"
style="display:block;width:100%;min-height:300px;height:100%;border:none;padding:0;margin:0;"
onload="resizeIframe()"
/>



Loading…
Cancel
Save