Author: igorz
Date: 2007-02-19 07:49:38 -0500 (Mon, 19 Feb 2007)
New Revision: 73111

Modified:
   trunk/mcs/class/System.Web/resources/ChangeLog
   trunk/mcs/class/System.Web/resources/webform.js
Log:
2007-02-19 Igor Zelmanovich <[EMAIL PROTECTED]>

        * webform.js: fixed WebForm_ReEnableControls


Modified: trunk/mcs/class/System.Web/resources/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/resources/ChangeLog      2007-02-19 12:41:56 UTC 
(rev 73110)
+++ trunk/mcs/class/System.Web/resources/ChangeLog      2007-02-19 12:49:38 UTC 
(rev 73111)
@@ -1,3 +1,7 @@
+2007-02-19 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+       * webform.js: fixed WebForm_ReEnableControls
+
 2007-02-18  Eyal Alaluf <[EMAIL PROTECTED]>
 
        * webform.js: Adding an optional parameter for passing the form to all 
JS

Modified: trunk/mcs/class/System.Web/resources/webform.js
===================================================================
--- trunk/mcs/class/System.Web/resources/webform.js     2007-02-19 12:41:56 UTC 
(rev 73110)
+++ trunk/mcs/class/System.Web/resources/webform.js     2007-02-19 12:49:38 UTC 
(rev 73111)
@@ -82,29 +82,31 @@
        return null;
 }
 
-function wasControlEnabled (id)
+function WebForm_ReEnableControls (currForm)
 {
-       if (typeof (__enabledControlArray) == 'undefined')
+       if (typeof(currForm.__enabledControlArray) != 'undefined' && 
currForm.__enabledControlArray != null)
+               __enabledControlArray = currForm.__enabledControlArray;
+       
+       if (typeof(__enabledControlArray) == 'undefined' || 
__enabledControlArray == null)
                return false;
-
-       for (var i = 0; i < __enabledControlArray.length; i ++) {
-               if (id == __enabledControlArray[i])
-                       return true;
+       
+       currForm.__disabledControlArray = new Array();
+       for (var i = 0; i < __enabledControlArray.length; i++) {
+               var c = document.getElementById(__enabledControlArray[i]);
+               if ((typeof(c) != "undefined") && (c != null) && (c.disabled == 
true)) {
+                       c.disabled = false;
+                       
currForm.__disabledControlArray[currForm.__disabledControlArray.length] = c;
+               }
        }
-
-       return false;
+       __currForm = currForm
+       setTimeout("WebForm_ReDisableControls (__currForm)", 0);
+       return true;
 }
 
-function WebForm_ReEnableControls (currForm)
+function WebForm_ReDisableControls (currForm)
 {
-       currForm = currForm || theForm;
-       if (typeof (currForm) == 'undefined')
-               return;
-
-       for (var i = 0; i < currForm.childNodes.length; i ++) {
-               var node = currForm.childNodes[i];
-               if (node.disabled && wasControlEnabled (node.id))
-                       node.disabled = false;
+       for (var i = 0; i < currForm.__disabledControlArray.length; i++) {
+               currForm.__disabledControlArray[i].disabled = true;
        }
 }
 

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to