mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-03 19:45:44 -05:00
To avoid possible duplicate browser requests for PaperScript files, support the data-src attribute as well as src.
Closes #749.
This commit is contained in:
parent
eb3628063c
commit
27b7063fc4
1 changed files with 5 additions and 1 deletions
|
@ -456,7 +456,11 @@ Base.exports.PaperScript = (function() {
|
|||
// project is created for it now.
|
||||
var canvasId = PaperScope.getAttribute(script, 'canvas'),
|
||||
canvas = document.getElementById(canvasId),
|
||||
src = script.src,
|
||||
// To avoid possible duplicate browser requests for PaperScript
|
||||
// files, support the data-src attribute as well as src:
|
||||
// TODO: Consider switching from data-paper- to data- prefix
|
||||
// in PaperScope.getAttribute() and use it here too:
|
||||
src = script.src || script.getAttribute('data-src'),
|
||||
async = PaperScope.hasAttribute(script, 'async'),
|
||||
scopeAttribute = 'data-paper-scope';
|
||||
if (!canvas)
|
||||
|
|
Loading…
Reference in a new issue