includes/clientside/static/editor.js
changeset 461 717e71109645
parent 420 301f546688d1
child 473 518bc2b214f1
--- a/includes/clientside/static/editor.js	Sun Feb 24 12:52:07 2008 -0500
+++ b/includes/clientside/static/editor.js	Sun Feb 24 17:50:38 2008 -0500
@@ -34,12 +34,29 @@
   content_css : css_url
 };
 
+// Check tinyMCE to make sure its init is finished
+function tinymce_init_check()
+{
+  if ( typeof(tinyMCE.init) != 'function' )
+    return false;
+  if ( typeof(tinymce.DOM) != 'object' )
+    return false;
+  if ( typeof(tinymce.DOM.get) != 'function' )
+    return false;
+  return true;
+}
+
 var initTinyMCE = function(e)
 {
   if ( typeof(tinyMCE) == 'object' )
   {
     if ( !KILL_SWITCH && !DISABLE_MCE )
     {
+      if ( !tinymce_init_check() )
+      {
+        setTimeout('initTinyMCE();', 200);
+        return false;
+      }
       tinyMCE.init(enano_tinymce_options);
     }
   }