diff options
author | Thomas Lange <code@nerdmind.de> | 2016-05-13 21:50:30 +0200 |
---|---|---|
committer | Thomas Lange <code@nerdmind.de> | 2016-05-13 21:50:30 +0200 |
commit | cdcab5593311b4bdec2b54c070d9f6133b95aaa7 (patch) | |
tree | 3029e0669d76f31284c82abcc88ff576eb5cc986 /static | |
parent | dab0de04e474a11311bf004d26ce238e512dbf2c (diff) | |
download | bigpipe-cdcab5593311b4bdec2b54c070d9f6133b95aaa7.tar.gz bigpipe-cdcab5593311b4bdec2b54c070d9f6133b95aaa7.tar.xz bigpipe-cdcab5593311b4bdec2b54c070d9f6133b95aaa7.zip |
Multiple updates
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 |