@dualbox/editor 1.0.23 → 1.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/js/dist/GraphEditor.js +78 -56
- package/js/src/GraphEditor.js +18 -2
- package/package.json +1 -1
package/js/src/GraphEditor.js
CHANGED
|
@@ -309,8 +309,21 @@ class DualboxEditor {
|
|
|
309
309
|
}
|
|
310
310
|
}
|
|
311
311
|
|
|
312
|
+
var loadScript = (pkg, cb) => {
|
|
313
|
+
if( attrs.load ) {
|
|
314
|
+
attrs.load( pkg.name, pkg.version, cb);
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
cb();
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
// we need to find the package.json and make sure the script is loaded
|
|
312
322
|
if( this.packages[name] ) {
|
|
313
|
-
|
|
323
|
+
loadScript(this.packages[name], (err) => {
|
|
324
|
+
if( err ) reject(err)
|
|
325
|
+
else resolve(this.packages[name]);
|
|
326
|
+
});
|
|
314
327
|
}
|
|
315
328
|
else {
|
|
316
329
|
// mark the package as beeing resolved
|
|
@@ -320,7 +333,10 @@ class DualboxEditor {
|
|
|
320
333
|
}
|
|
321
334
|
else {
|
|
322
335
|
this.packages[name] = result; // cache result
|
|
323
|
-
|
|
336
|
+
loadScript(this.packages[name], (err) => {
|
|
337
|
+
if( err ) reject(err)
|
|
338
|
+
else resolve(result);
|
|
339
|
+
});
|
|
324
340
|
}
|
|
325
341
|
});
|
|
326
342
|
}
|