plugins/SpecialPageFuncs.php
changeset 588 20484deb89cd
parent 581 5e8fd89c02ea
child 590 03a60844c7c5
--- a/plugins/SpecialPageFuncs.php	Thu Jun 26 18:05:42 2008 -0400
+++ b/plugins/SpecialPageFuncs.php	Thu Jun 26 20:55:13 2008 -0400
@@ -177,8 +177,11 @@
   ?>
   <enano:no-opt>
   <script type="text/javascript">
-    function cpGenPreviewUrl()
+    window.cpGenPreviewUrl = function()
     {
+      if ( typeof(load_component) != 'function' )
+        return false;
+      
       var frm = document.forms['create_form'];
       var radio_custom = frm.getElementsByTagName('input')[2];
       var use_custom_url = radio_custom.checked;
@@ -250,7 +253,7 @@
     
   echo '</form>';
   
-  echo '<script type="text/javascript">cpGenPreviewUrl();</script>';
+  echo '<script type="text/javascript">addOnloadHook(cpGenPreviewUrl); addOnloadHook(function(){load_component(\'expander\')});</script>';
   
   $template->footer();
 }