From cdcab5593311b4bdec2b54c070d9f6133b95aaa7 Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Fri, 13 May 2016 21:50:30 +0200 Subject: Multiple updates --- static/bigpipe.js | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'static') 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 -- cgit v1.2.3