mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Merge pull request #156 from ubershmekel/patch-2
Late load of paperjs should still run paperscripts
This commit is contained in:
commit
6729646e7a
1 changed files with 7 additions and 1 deletions
|
@ -294,7 +294,13 @@ var PaperScript = this.PaperScript = new function() {
|
|||
}
|
||||
}
|
||||
|
||||
DomEvent.add(window, { load: load });
|
||||
// Catch cases where paperjs is loaded after the browser event has already occurred.
|
||||
if ( document.readyState === "complete" ) {
|
||||
// Handle it asynchronously
|
||||
setTimeout( load );
|
||||
} else {
|
||||
DomEvent.add(window, { load: load });
|
||||
}
|
||||
|
||||
// Produces helpers to e.g. check for both 'canvas' and 'data-paper-canvas'
|
||||
// attributes:
|
||||
|
|
Loading…
Reference in a new issue