aboutsummaryrefslogtreecommitdiffstats
path: root/static
diff options
context:
space:
mode:
authorThomas Lange <code@nerdmind.de>2016-05-13 21:50:30 +0200
committerThomas Lange <code@nerdmind.de>2016-05-13 21:50:30 +0200
commitcdcab5593311b4bdec2b54c070d9f6133b95aaa7 (patch)
tree3029e0669d76f31284c82abcc88ff576eb5cc986 /static
parentdab0de04e474a11311bf004d26ce238e512dbf2c (diff)
downloadbigpipe-cdcab5593311b4bdec2b54c070d9f6133b95aaa7.tar.gz
bigpipe-cdcab5593311b4bdec2b54c070d9f6133b95aaa7.tar.xz
bigpipe-cdcab5593311b4bdec2b54c070d9f6133b95aaa7.zip
Multiple updates
Diffstat (limited to 'static')
-rwxr-xr-xstatic/bigpipe.js20
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