Skip to content

Commit

Permalink
1. import require() function rather than using global one.
Browse files Browse the repository at this point in the history
2. make loaded[path] always contain Promise for id of <symbol> matching path,
    rather than sometimes containing ID of layer
  • Loading branch information
wkeese committed Oct 27, 2015
1 parent b882c78 commit 6719101
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@
*/

define([
"require",
"./has",
"./Promise!",
"module",
"requirejs-text/text",
"requirejs-domready/domReady"
], function (has, Promise, module) {
], function (require, has, Promise, module) {
"use strict";

var loaded = {}, // paths of loaded svgs
Expand Down Expand Up @@ -63,13 +64,13 @@ define([
}
var symbol = extractGraphicAsSymbol(document, svgText);
sprite.appendChild(symbol);
resolve(symbol.getAttribute("id"));
resolve(idInLayer || symbol.getAttribute("id"));
});
});
}

loaded[path].then(function (symbolId) {
onload(idInLayer || symbolId);
onload(symbolId);
});
}
}
Expand Down

0 comments on commit 6719101

Please sign in to comment.