mirror of
https://github.com/processing/processing4.git
synced 2026-01-30 20:01:09 +01:00
14 lines
343 B
JavaScript
14 lines
343 B
JavaScript
|
|
// wait for document to load
|
|
window.onload = function () {
|
|
tryFindSketch();
|
|
}
|
|
|
|
function tryFindSketch () {
|
|
var sketch = Processing.getInstanceById( getProcessingSketchID() );
|
|
if ( sketch == undefined )
|
|
setTimeout(tryFindSketch, 200); // retry after 0.2 secs
|
|
else
|
|
sketch.setTree( document.body.parentNode );
|
|
}
|