Updating continuing bar when adding/removing child points

This commit is contained in:
Stefan Persson 2011-02-07 11:04:35 +00:00
parent 984f0f8820
commit 8c788c7b07
2 changed files with 4 additions and 2 deletions

View file

@ -420,7 +420,7 @@ Rectangle{
} }
function remove(keepDialogOpen, ignoreParent){ function remove(keepDialogOpen, ignoreParent){
if(ignoreParent == undefined && pointRect.parentPoint != undefined){ if(keepDialogOpen == undefined && ignoreParent == undefined && pointRect.parentPoint != undefined){
//remove from parent instead //remove from parent instead
pointRect.parentPoint.remove(); pointRect.parentPoint.remove();
return; return;
@ -491,10 +491,12 @@ Rectangle{
else if(originalPoint.getChildPoint(index) == undefined){ else if(originalPoint.getChildPoint(index) == undefined){
print("CREATE NEW POINT"); print("CREATE NEW POINT");
originalPoint.addChildPoint(index, deviceRow.createChildPoint(index, pointRect, deviceRow.deviceId)); originalPoint.addChildPoint(index, deviceRow.createChildPoint(index, pointRect, deviceRow.deviceId));
pointRect.deviceRow.updateContinuingBars();
} }
else{ else{
print("REMOVE A POINT"); print("REMOVE A POINT");
originalPoint.removeChildPoint(index); originalPoint.removeChildPoint(index);
pointRect.deviceRow.updateContinuingBars();
} }
} }

View file

@ -387,7 +387,7 @@ function addChildPoint(index, point){
function removeChildPoint(index){ function removeChildPoint(index){
print("INDEX BEFORE REMOVE: " + childPoints[index]); print("INDEX BEFORE REMOVE: " + childPoints[index]);
var toBeRemoved = childPoints[index]; var toBeRemoved = childPoints[index];
childPoints[index] = undefined; delete childPoints[index]; // = undefined;
toBeRemoved.remove("true"); toBeRemoved.remove("true");
print("INDEX AFTER REMOVE: " + childPoints[index]); print("INDEX AFTER REMOVE: " + childPoints[index]);
} }