Author: sevein
Date: Thu Aug 11 15:27:09 2011
New Revision: 9481

Log:
Revert latest commit in dialog.js, trying to tackle multi-value autocomplete 
need in some other way

Modified:
   trunk/js/dialog.js

Modified: trunk/js/dialog.js
==============================================================================
--- trunk/js/dialog.js  Wed Aug 10 16:13:34 2011        (r9480)
+++ trunk/js/dialog.js  Thu Aug 11 15:27:09 2011        (r9481)
@@ -346,8 +346,19 @@
 
         this.save = function (yuiDialogData)
           {
-            var process = function (input)
+            $('input.form-autocomplete', thisDialog.table).each(function ()
               {
+                $hidden = $(this).prev('input:hidden');
+
+                // Test for existing <iframe/>
+                for (var i in thisDialog.iframes)
+                {
+                  if (thisDialog.id === thisDialog.iframes[i].dialogId && 
$hidden.attr('name') === thisDialog.iframes[i].inputName)
+                  {
+                    var index = i;
+                  }
+                }
+
                 // Test if autocomplete has a value
                 if (0 < this.value.length)
                 {
@@ -383,23 +394,12 @@
                       }
                     }
                   }
-                };
-              };
 
-            $('input.form-autocomplete', thisDialog.table).each(function ()
-              {
-                // It is multivalue if exists a <ul> element between its 
siblings
-                var $ul = $('~ ul', this);
-                if ($ul.length)
-                {
-                  $ul.find('li > input').each(function()
-                    {
-                      // Call process()
-                    });
-                }
-                else
-                {
-                  // Call process()
+                  // Remove <iframe/> if selecting a pre-existing value
+                  else if (undefined !== index && this.value !== 
thisDialog.iframes[index].iframe.value)
+                  {
+                    delete thisDialog.iframes[index];
+                  }
                 }
               });
 

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to