Author: deryck
Date: 2005-04-06 21:45:32 +0000 (Wed, 06 Apr 2005)
New Revision: 6227

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=6227

Log:

Correct fix for testing page load before dynamically
loading another page in the help menu.

--deryck
(remembering the fable--"slow and steady wins the race") :-)

Modified:
   trunk/swat/js/domPipe.js


Changeset:
Modified: trunk/swat/js/domPipe.js
===================================================================
--- trunk/swat/js/domPipe.js    2005-04-06 16:48:28 UTC (rev 6226)
+++ trunk/swat/js/domPipe.js    2005-04-06 21:45:32 UTC (rev 6227)
@@ -33,7 +33,8 @@
        sandbox.setAttribute('id', 'stage');
        page.appendChild(sandbox);
 
-       var curtain = document.getElementById('stage');
+       // Don't declare this one local, either
+       curtain = document.getElementById('stage');
        curtain.style.position = 'absolute';
        curtain.style.top = '-1200px';
 }
@@ -100,8 +101,9 @@
 // Ensure iframe has finished loading before cut-n-paste
 function checkStage(target)
 {
-       if (stage.document.getElementsByTagName('body')[0]) {
+       if ( (stage.document.getElementsByTagName('body')[0]) && 
(stage.document.getElementsByTagName('body')[0].childNodes.length >= 1) ) {
                getPage(target);
+               page.removeChild(curtain)
                clearInterval(docCheck);
        }
 }
@@ -111,6 +113,7 @@
 {
        var target;
 
+       // Pass id as quoted string if not 'page'
        if (id == 'page') {
                target = id;
        } else {

Reply via email to