From d003c46650945dd504efa54aa001ad263cf657f5 Mon Sep 17 00:00:00 2001 From: Thomas Berezansky Date: Fri, 28 Sep 2012 15:09:29 -0400 Subject: [PATCH] Scoping Issues: Use a function to resolve The loop scoping doesn't play nice with the load callback. By wrapping all of that in a function we create a new scope and solve the issue. Signed-off-by: Thomas Berezansky --- Open-ILS/xul/staff_client/server/circ/circ_summary.xul | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Open-ILS/xul/staff_client/server/circ/circ_summary.xul b/Open-ILS/xul/staff_client/server/circ/circ_summary.xul index 6b7f6fa686..70600cdd89 100644 --- a/Open-ILS/xul/staff_client/server/circ/circ_summary.xul +++ b/Open-ILS/xul/staff_client/server/circ/circ_summary.xul @@ -94,18 +94,21 @@ $('r_last').disabled = false; $('r_all').disabled = false; var gb = $('circs'); - for (var j = 0; j < g.circs.length; j++) { + function addcirc(circid) { var iframe = document.createElement('iframe'); iframe.setAttribute('style','overflow: none; min-height: 100px;'); iframe.setAttribute('flex','1'); gb.appendChild(iframe); var setXulG = function() { - get_contentWindow(iframe).xulG = { 'circ_id' : g.circs[j].id() }; + get_contentWindow(iframe).xulG = { 'circ_id' : circid }; iframe.removeEventListener('load', setXulG, true); }; iframe.addEventListener('load', setXulG, true); iframe.setAttribute('src', urls.XUL_CIRC_BRIEF); // + '?circ_id=' + g.circs[j].id() ); } + for (var j = 0; j < g.circs.length; j++) { + addcirc(g.circs[j].id()); + } } catch(E) { g.error.standard_unexpected_error_alert('error showing circs',E); } -- 2.11.0