soulwire / sketch.js

Cross-Platform JavaScript Creative Coding Framework
MIT License
4.09k stars 431 forks source link

Fix dom ready issue #67

Open bitinn opened 9 years ago

bitinn commented 9 years ago

Fix #50, by not using doc.body until Sketch.create() is called.

Note that you still need dom ready for Sketch.create() to work, I updated the drawing example to demonstrate this requirement.

Both test cases and demos have been ran successfully to confirm this change is working.

PS: given both window and document are in global context, I find passing both this and this.document a bit unnecessary, so clean that up a bit as well.