diff options
Diffstat (limited to 'static')
-rwxr-xr-x | static/bigpipe.js | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/static/bigpipe.js b/static/bigpipe.js index fed6e39..30d1f55 100755 --- a/static/bigpipe.js +++ b/static/bigpipe.js @@ -28,6 +28,8 @@ var BigPipe = (function() { element.async = true;
}
+ element.setAttribute('class', 'bigpipe');
+
document.head.appendChild(element);
element.onload = function() {
@@ -143,11 +145,13 @@ var BigPipe = (function() { // Pagelet: Executes the main JS code of the pagelet
//==============================================================================
Pagelet.prototype.executeJSCode = function() {
- try {
- globalExecution(this.JSCode);
- } catch(e) {
- console.error(this.pageletID + ": " + e);
- }
+ this.JSCode.forEach(function(code) {
+ try {
+ globalExecution(code);
+ } catch(e) {
+ console.error(this.pageletID + ": " + e);
+ }
+ });
};
//==============================================================================
@@ -268,6 +272,12 @@ var BigPipe = (function() { BigPipe.pagelets = [];
BigPipe.offset = 0;
BigPipe.phase = 0;
+
+ var resources = document.head.getElementsByClassName('bigpipe');
+
+ while(resources[0]) {
+ resources[0].parentNode.removeChild(resources[0]);
+ }
}
};
})();
\ No newline at end of file |