includes/clientside/static/messagebox.js
changeset 628 ab6f55abb17e
parent 582 a38876c0793c
child 652 26ce2694d43f
--- a/includes/clientside/static/messagebox.js	Sat Jul 12 00:31:44 2008 -0400
+++ b/includes/clientside/static/messagebox.js	Sat Jul 12 03:32:57 2008 -0400
@@ -380,6 +380,8 @@
         domObjChangeOpac(100, wrapper);
       }, 40);
   }
+  
+  return wrapper;
 }
 
 /**
@@ -477,28 +479,36 @@
 
 function miniPromptMessage(parms)
 {
-  if ( !parms.title || !parms.message || !parms.buttons )
+  if ( ( !parms.title && !parms.message ) || !parms.buttons )
     return false;
   
   return miniPrompt(function(parent)
     {
       try
       {
-        var h3 = document.createElement('h3');
-        h3.appendChild(document.createTextNode(parms.title));
-        var body = document.createElement('p');
-        var message = parms.message.split(unescape('%0A'));
-        for ( var i = 0; i < message.length; i++ )
+        if ( parms.title )
+        {
+          var h3 = document.createElement('h3');
+          h3.appendChild(document.createTextNode(parms.title));
+        }
+        if ( parms.message )
         {
-          body.appendChild(document.createTextNode(message[i]));
-          if ( i + 1 < message.length )
-            body.appendChild(document.createElement('br'));
+          var body = document.createElement('p');
+          var message = parms.message.split(unescape('%0A'));
+          for ( var i = 0; i < message.length; i++ )
+          {
+            body.appendChild(document.createTextNode(message[i]));
+            if ( i + 1 < message.length )
+              body.appendChild(document.createElement('br'));
+          }
         }
         
         parent.style.textAlign = 'center';
         
-        parent.appendChild(h3);
-        parent.appendChild(body);
+        if ( parms.title )
+          parent.appendChild(h3);
+        if ( parms.message )
+          parent.appendChild(body);
         parent.appendChild(document.createElement('br'));
         
         // construct buttons