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

Lukas Giessmann lgiessmann at common-lisp.net
Wed Feb 3 15:54:09 UTC 2010


Author: lgiessmann
Date: Wed Feb  3 10:54:09 2010
New Revision: 178

Log:
ajax-client: fixed a bug in the dblClickHandler of TextrowC; fixed a bug in the removeHandler of IdentifierC

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

Modified: trunk/src/ajax/javascripts/datamodel.js
==============================================================================
--- trunk/src/ajax/javascripts/datamodel.js	(original)
+++ trunk/src/ajax/javascripts/datamodel.js	Wed Feb  3 10:54:09 2010
@@ -105,12 +105,14 @@
                                          checkRemoveAddButtons(owner, min, max, null);
                                          var myself = this;
                                          setRemoveAddHandler(this, true, owner, min, max, function(){
-					     return new TextrowC("", regexp, owner, min, max, cssTitle, dblClickHandler);
+					     return new TextrowC("", regexp, owner, min, max, cssTitle, this.__dblClickHandler__);
 					 });
     
-                                         this.getFrame().observe("dblclick", function(event){
-					     dblClickHandler(owner, event);
-					 });
+					 if(this.__dblClickHandler__){
+					     this.getFrame().observe("dblclick", function(event){
+						     this.__dblClickHandler__(owner, event);
+						 });
+					 }
                                       },
 				     "dblClick" : function(){
 					 if(this.__dblClickHandler__) this.__dblClickHandler__(this.__owner__);
@@ -494,8 +496,8 @@
 								    if(min === 0) dblClickHandler = dblClickHandlerF;
 								    var _content = "";
 								    if(_contents && _contents.length > j) _content = _contents[j];
-								    var row = new TextrowC(_content, constraints[i].regexp, this.__containers__[i],
-											   min === 0 ? 1 : min, max === MMAX_INT ? -1 : max, cssTitle, dblClickHandler);
+								    
+								    var row = new TextrowC(_content, constraints[i].regexp, this.__containers__[i], min === 0 ? 1 : min, max === MMAX_INT ? -1 : max, cssTitle, dblClickHandler);
 								    if(!_content) row.dblClick();
 								    this.__error__.insert({"before" : row.getFrame()});
 								}
@@ -1440,9 +1442,11 @@
 					      
 					      addSecondShowHandler(this);
 
-					      this.getFrame().observe("dblclick", function(event){
-						  dblClickHandler(owner, event);
-					      });
+					      if(dblClickHandler){
+						  this.getFrame().observe("dblclick", function(event){
+							  dblClickHandler(owner, event);
+						      });
+					      }
                                           }
                                           catch(err){
                                       	      alert("From NameC(): " + err);
@@ -1817,9 +1821,11 @@
 						    }
 						    makeResource(this, contents, constraint, dataType, cssTitle, {"rows" : 5, "cols" : 70});
 
-						    this.getFrame().observe("dblclick", function(event){
-							dblClickHandler(owner, event);
-						    });
+						    if(dblClickHandler){
+							this.getFrame().observe("dblclick", function(event){
+								dblClickHandler(owner, event);
+							    });
+						    }
 						}
                                                 catch(err){
 						    alert("From OccurrenceC(): " + err);
@@ -3918,7 +3924,7 @@
 	if(disabled === false){
 	    var newElem = call();
 	    myself.append(newElem.getFrame());
-	    if((remove === true && min !== -1 && owner.__frames__.length > min) || !constraint){
+	    if((myself.remove === true && min !== -1 && owner.__frames__.length > min) || !constraint){
 		for(var i = 0; i != owner.__frames__.length; ++i){
 		    owner.__frames__[i].showRemoveButton();
 		}




More information about the Isidorus-cvs mailing list