bruce-models 2.5.6 → 2.5.8
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/dist/bruce-models.es5.js
CHANGED
|
@@ -11668,6 +11668,9 @@ var Plugin;
|
|
|
11668
11668
|
api
|
|
11669
11669
|
})).plugin;
|
|
11670
11670
|
}
|
|
11671
|
+
if (plugin && !pluginId) {
|
|
11672
|
+
pluginId = plugin.ID;
|
|
11673
|
+
}
|
|
11671
11674
|
const { indexFileUrl } = GetLoadUrl({
|
|
11672
11675
|
api,
|
|
11673
11676
|
pluginId,
|
|
@@ -11680,20 +11683,30 @@ var Plugin;
|
|
|
11680
11683
|
const paramsId = ObjectUtils.UId();
|
|
11681
11684
|
window[paramsId] = pluginParams ? pluginParams : {};
|
|
11682
11685
|
const disposeId = ObjectUtils.UId();
|
|
11686
|
+
const elementId = ObjectUtils.UId();
|
|
11683
11687
|
let script = `
|
|
11684
11688
|
function run() {
|
|
11685
11689
|
${fileContent}
|
|
11686
11690
|
|
|
11687
11691
|
const paramsId = "${paramsId}";
|
|
11688
|
-
const containerId = "${
|
|
11692
|
+
const containerId = "${containerId}";
|
|
11689
11693
|
let container;
|
|
11690
11694
|
if (containerId) {
|
|
11691
|
-
container = document.getElementById("${
|
|
11695
|
+
container = document.getElementById("${containerId}");
|
|
11696
|
+
}
|
|
11697
|
+
|
|
11698
|
+
let pluginHTML = null;
|
|
11699
|
+
if (container) {
|
|
11700
|
+
pluginHTML = document.createElement("div");
|
|
11701
|
+
pluginHTML.id = "${elementId}";
|
|
11702
|
+
container.appendChild(pluginHTML);
|
|
11692
11703
|
}
|
|
11704
|
+
|
|
11693
11705
|
{TEMPLATE_CODE}
|
|
11694
11706
|
const params = window["${paramsId}"];
|
|
11695
11707
|
|
|
11696
11708
|
window["${disposeId}"] = Run({
|
|
11709
|
+
element: pluginHTML,
|
|
11697
11710
|
container: container,
|
|
11698
11711
|
pluginParams: params
|
|
11699
11712
|
});
|
|
@@ -11721,7 +11734,15 @@ var Plugin;
|
|
|
11721
11734
|
};
|
|
11722
11735
|
}
|
|
11723
11736
|
const callDispose = window[disposeId];
|
|
11724
|
-
return () =>
|
|
11737
|
+
return () => {
|
|
11738
|
+
if (elementId) {
|
|
11739
|
+
const element = document.getElementById(elementId);
|
|
11740
|
+
if (element && element.parentElement) {
|
|
11741
|
+
element.parentElement.removeChild(element);
|
|
11742
|
+
}
|
|
11743
|
+
}
|
|
11744
|
+
callDispose();
|
|
11745
|
+
};
|
|
11725
11746
|
}
|
|
11726
11747
|
};
|
|
11727
11748
|
});
|