Bug #8791: IE8 needs this global variable defined with the 'window.' prefix
authorMichael M Slusarz <slusarz@curecanti.org>
Mon, 21 Dec 2009 18:38:45 +0000 (11:38 -0700)
committerMichael M Slusarz <slusarz@curecanti.org>
Mon, 21 Dec 2009 18:38:45 +0000 (11:38 -0700)
framework/Tree/lib/Horde/Tree/Javascript.php

index 3fe2a72..0cfd57d 100644 (file)
@@ -91,7 +91,7 @@ class Horde_Tree_Javascript extends Horde_Tree
         );
 
         Horde::addInlineScript(array(
-            $this->_instance . ' = new Horde_Tree(' . Horde_Serialize::serialize($opts, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ')',
+            'window.' . $this->_instance . ' = new Horde_Tree(' . Horde_Serialize::serialize($opts, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ')',
             $this->renderNodeDefinitions()
         ), 'dom');
 
@@ -119,7 +119,7 @@ class Horde_Tree_Javascript extends Horde_Tree
     {
         $this->_buildIndents($this->_root_nodes);
 
-        return $this->_instance . '.renderTree(' . Horde_Serialize::serialize($this->_nodes, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ',' . Horde_Serialize::serialize($this->_root_nodes, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ',' . ($this->_static ? 'true' : 'false') . ')';
+        return 'window.' . $this->_instance . '.renderTree(' . Horde_Serialize::serialize($this->_nodes, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ',' . Horde_Serialize::serialize($this->_root_nodes, Horde_Serialize::JSON, Horde_Nls::getCharset()) . ',' . ($this->_static ? 'true' : 'false') . ')';
     }
 
 }