mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-26 21:59:46 -04:00
Define a unique id for each PaperScript.
This commit is contained in:
parent
3cb78db5f5
commit
06f16d0c2a
2 changed files with 4 additions and 3 deletions
src/core
|
@ -207,13 +207,13 @@ var PaperScript = this.PaperScript = new function() {
|
|||
var scripts = document.getElementsByTagName('script');
|
||||
for (var i = 0, l = scripts.length; i < l; i++) {
|
||||
var script = scripts[i];
|
||||
// Only load this cript if it not loaded already.
|
||||
// Only load this script if it not loaded already.
|
||||
if (script.type === 'text/paperscript'
|
||||
&& !script.getAttribute('loaded')) {
|
||||
// Produce a new PaperScope for this script now. Scopes are
|
||||
// cheap so let's not worry about the initial one that was
|
||||
// already created.
|
||||
var scope = new PaperScope();
|
||||
var scope = new PaperScope(script.src || ('script-' + i));
|
||||
// If a canvas id is provided, create a document for it now,
|
||||
// so the active document is defined.
|
||||
var canvas = script.getAttribute('canvas');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue