[isidorus-cvs] r66 - trunk/src/ajax/javascripts

Lukas Giessmann lgiessmann at common-lisp.net
Thu Jun 25 10:50:01 UTC 2009


Author: lgiessmann
Date: Thu Jun 25 06:49:59 2009
New Revision: 66

Log:
ajax-client: fixed some bugs which occurs by validating scopes; now it is also possible to edit fragments (but not the instanceOf-element) and commit them if they are valid;

Modified:
   trunk/src/ajax/javascripts/create.js
   trunk/src/ajax/javascripts/datamodel.js

Modified: trunk/src/ajax/javascripts/create.js
==============================================================================
--- trunk/src/ajax/javascripts/create.js	(original)
+++ trunk/src/ajax/javascripts/create.js	Thu Jun 25 06:49:59 2009
@@ -89,6 +89,14 @@
     var tmId = new TmIdC(tmContent);
     var liTm = new Element("li", {"class" : CLASSES.tmIdFrame()}).update(tmId.getFrame());
     liA.insert({"after" : liTm});
+
+    // --- validates the data if there is any content
+    if(contents){
+	topic.isValid();
+	if(associations) associations.isValid();
+	tmId.isValid();
+    }
+
     var commitButton = new Element("input", {"type" : "button", "value" : "commit fragment"})
     commitButton.observe("click", function(event){
 	// --- validates the given data

Modified: trunk/src/ajax/javascripts/datamodel.js
==============================================================================
--- trunk/src/ajax/javascripts/datamodel.js	(original)
+++ trunk/src/ajax/javascripts/datamodel.js	Thu Jun 25 06:49:59 2009
@@ -3294,9 +3294,6 @@
 						   }
 						   this.__disable__ = false;
 					       },
-					       "scopeIsValid" : function(){
-						   return this.__scope__.isValid();
-					       },
 					       "isValid" : function(){
 						   var ret = true;
 						   var errorStr = "";
@@ -3423,10 +3420,9 @@
 						       }
 						   }
 						   
-						   var scopeValid = this.scopeIsValid();
 						   if(ret === false) this.showError(errorStr);
 						   else this.hideError();
-						   return ret && scopeIsValid;
+						   return ret;
 					       }});
 
 
@@ -3537,7 +3533,7 @@
 						     ",\"roles\":" + this.__roles__.toJSON() + "}";
 					     },
 					     "isValid" : function(){
-						 return this.__roles__.isValid();
+						 return this.__roles__.isValid() && this.__scope__.isValid();
 					     },
 					     "disable" : function(){
 						 this.hideError();




More information about the Isidorus-cvs mailing list