From e5f8ed4dedc9588ad8456420f4895287c08946c5 Mon Sep 17 00:00:00 2001
From: Thomas BrĂ¼derli
Date: Mon, 2 Jul 2007 15:08:10 +0000
Subject: Wait for parent window to load it_state script

---
 itjs/state.html | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

(limited to 'itjs/state.html')

diff --git a/itjs/state.html b/itjs/state.html
index 08ab639..3029932 100644
--- a/itjs/state.html
+++ b/itjs/state.html
@@ -5,11 +5,13 @@ return <<<EOF
 <head>
 <title></title>
 <script type="text/javascript">
+var state_load_attempts = 0;
 function state_onload()
 {
-	if (parent.it_state)
+	if (state_load_attempts < 30)
 	{
-		if (parent.it_state.ready)
+		state_load_attempts++;
+		if (parent.it_state && parent.it_state.ready)
 			parent.setTimeout(parent.it_state_restore_history, 1);
 		else
 			window.setTimeout(state_onload, 90);
-- 
cgit v1.2.3