From: Kai Moritz Date: Thu, 28 Feb 2013 11:30:58 +0000 (+0100) Subject: Replaced doubled variable ads with queue X-Git-Tag: 0.2.0~6 X-Git-Url: http://juplo.de/gitweb/?p=openx;a=commitdiff_plain;h=000ac4f4f9152d9ce789246097279cbd4d5c18b4 Replaced doubled variable ads with queue Both variables queue and ads served the same purpose. Hence, the doubled variable was removed: queue now does the deal alone. --- diff --git a/jquery.openx.js b/jquery.openx.js index 352d0ac..3f3669f 100644 --- a/jquery.openx.js +++ b/jquery.openx.js @@ -30,7 +30,6 @@ count = 0, slots = {}, queue = [], - ads = [], output = []; @@ -217,12 +216,13 @@ function init_ads() { - var i, id; + var i, id, ads = []; for (i=0; i 0) { + while (queue.length > 0) { var result, src, inline; - id = ads.shift(); + id = queue.shift(); node = slots[id]; node.slideDown(); @@ -281,7 +281,7 @@ /** script-tag with src-URL! */ if (OA_output[id].length > 0) /** The banner-code was not rendered completely yet! */ - ads.unshift(id); + queue.unshift(id); /** Load the script and halt all work until the script is loaded and executed... */ $.getScript(result[1], render_ads); // << jQuery.getScript() generates onload-Handler for _all_ browsers ;) return; @@ -308,7 +308,7 @@ for (var i=0; i