Skip to content

Commit

Permalink
Append automatic canvas to body instead of replace elements
Browse files Browse the repository at this point in the history
  • Loading branch information
xeolabs committed Apr 22, 2013
1 parent a7a01a1 commit 854aefa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/core/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ var SceneJS_Canvas = function (id, canvasId, contextAttr, options) {
// Automatic default canvas
canvasId = "canvas-" + id;
var body = document.getElementsByTagName("body")[0];
body.innerHTML = '';
var newdiv = document.createElement('div');
newdiv.style.height = "100%";
newdiv.style.width = "100%";
newdiv.innerHTML = '<canvas id="' + canvasId + '" style="width: 100%; height: 100%; margin: 0; padding: 0;"></canvas>';
newdiv.style.padding = "0";
newdiv.style.margin = "0";
newdiv.innerHTML += '<canvas id="' + canvasId + '" style="width: 100%; height: 100%; margin: 0; padding: 0;"></canvas>';
body.appendChild(newdiv);
}

Expand Down

0 comments on commit 854aefa

Please sign in to comment.