Skip to content

Commit

Permalink
[FIX] Use full screen size for QUnit HTML iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
matz3 committed Mar 27, 2019
1 parent d7826f1 commit e8c63a5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion lib/client/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ require("./discovery.js");
(function(window) {
const karma = window.__karma__;

function setFullSize(element) {
element.style.height = "100%";
element.style.padding = "0";
element.style.margin = "0";
}

// Set karma execution frame to full size, so that the iframe can use width/height 100%
setFullSize(document.documentElement);
setFullSize(document.body);

karma.start = function() {
const config = karma.config && karma.config.ui5 || {};

Expand All @@ -27,7 +37,9 @@ require("./discovery.js");
context._frame.onload = function() {
onload.call(null, context);
};
context._frame.setAttribute("style", "height: 1024px; width: 1280px;");
context._frame.style.height = "100%";
context._frame.style.width = "100%";
context._frame.style.border = "0";
context._frame.src = url;
document.body.appendChild(context._frame);
context.contentWindow = context._frame.contentWindow;
Expand Down

0 comments on commit e8c63a5

Please sign in to comment.