-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d9d95cf
commit 301d08f
Showing
3 changed files
with
38 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,23 @@ | ||
(function() { | ||
var demoArea = document.getElementById('demo-script'); | ||
var sourceCodeArea = document.createElement('pre'); | ||
sourceCodeArea.innerHTML = '<code class="language-javascript">' + demoArea.innerHTML + '<\/code>'; | ||
if (document.querySelector('.container')) { | ||
document.querySelector('.container').appendChild(sourceCodeArea) | ||
} | ||
else { | ||
document.body.appendChild(sourceCodeArea); | ||
if (demoArea) { | ||
var sourceCodeArea = document.createElement('pre'); | ||
|
||
sourceCodeArea.innerHTML = '<code class="language-javascript">' + demoArea.innerHTML + '<\/code>'; | ||
if (document.querySelector('.container')) { | ||
document.querySelector('.container').appendChild(sourceCodeArea) | ||
} | ||
else { | ||
document.body.appendChild(sourceCodeArea); | ||
} | ||
} | ||
|
||
setTimeout(function() { | ||
var height = parseInt(window.getComputedStyle(document.body).height) + 40; | ||
window.parent.postMessage(height, '*'); | ||
}, 100); | ||
if (window.postMessage) { | ||
setTimeout(function() { | ||
var height = parseInt(window.getComputedStyle(document.body).height) + 40; | ||
console.log(height); | ||
window.parent.postMessage(height, '*'); | ||
}, 100); | ||
} | ||
|
||
})(); |