[isidorus-cvs] r283 - trunk/src/ajax/javascripts
Lukas Giessmann
lgiessmann at common-lisp.net
Fri Apr 16 20:08:54 UTC 2010
Author: lgiessmann
Date: Fri Apr 16 16:08:53 2010
New Revision: 283
Log:
ui: after deleting names all variants of the deleted name are removed
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 Fri Apr 16 16:08:53 2010
@@ -1453,7 +1453,7 @@
if(contents){
var myself = this;
this.__table__.insert({"bottom" : makeRemoveLink(function(event){
- makeDeleteObject("Name", myself);
+ makeRemoveObject("Name", myself);
}, "delete Name")});
}
}
@@ -1858,7 +1858,7 @@
if(contents){
var myself = this;
this.__table__.insert({"bottom" : makeRemoveLink(function(event){
- makeDeleteObject("Occurrence", myself);
+ makeRemoveObject("Occurrence", myself);
}, "delete Occurrence")});
}
}
@@ -2276,7 +2276,7 @@
if(content){
var myself = this;
this.__table__.insert({"bottom" : makeRemoveLink(function(event){
- makeDeleteObject("Topic", myself);
+ makeRemoveObject("Topic", myself);
}, "delete Topic")});}
}catch(err){
alert("From TopciC(): " + err);
@@ -4351,14 +4351,14 @@
// --- calls the given object's mark-as-deleted service
-function makeDeleteObject(type, objectToDelete){
+function makeRemoveObject(type, objectToDelete){
if(type !== "Occurrence" && type !== "Name" && type !== "Variant"
&& type !== "Topic" && type !== "Association"){
- throw "From makeDeleteObject(): type must be: \"Occurrence\" || \"Name\" " +
+ throw "From makeRemoveObject(): type must be: \"Occurrence\" || \"Name\" " +
"|| \"Variant\" || \"Topic\" || \"Association\" but is " + type;
}
if (!objectToDelete){
- throw "From makeDeleteObject(): objectToDelete must be set";
+ throw "From makeRemoveObject(): objectToDelete must be set";
}
var parentTopic = "null";
@@ -4415,7 +4415,13 @@
}
else {
if(type === "Occurrence"){ objectToDelete.__value__.setValue(""); }
- else { objectToDelete.__value__.__frames__[0].__content__.setValue(""); }
+ else {
+ objectToDelete.__value__.__frames__[0].__content__.setValue("");
+ var vars = objectToDelete.__variants__;
+ objectToDelete.__variants__ = new VariantContainerC(null, objectToDelete);
+ vars.append(objectToDelete.__variants__.getFrame());
+ vars.remove();
+ }
var ii = objectToDelete.__itemIdentity__;
objectToDelete.__itemIdentity__ = new ItemIdentityC(null, objectToDelete);
ii.append(objectToDelete.__itemIdentity__.getFrame());
More information about the Isidorus-cvs
mailing list