Browse Source

moving a child of a container to one of its children (also a container) now correctly deletes the containment association

Simon Van Mierlo 8 years ago
parent
commit
8e3778f90d
2 changed files with 13 additions and 1 deletions
  1. 11 0
      client/data_utils.js
  2. 2 1
      client/geometry_utils.js

+ 11 - 0
client/data_utils.js

@@ -259,6 +259,17 @@ DataUtils = function(){
 							  'dest':it,
 							  'pos':[pathCenter.x,pathCenter.y],
 							  'segments':segments}});
+                              
+                 __icons[it]['edgesIn'].forEach(
+                        function(edgeId)
+                        {
+                            var linkIn = __edgeId2ends(edgeId)[0];
+                            if( __isContainmentConnectionType(linkIn) ) {
+                                requests.push(
+                                     {'method':'DELETE',
+                                      'uri':HttpUtils.url(linkIn,__NO_USERNAME+__NO_WID)});
+                            }
+                        });
 			});
 		
 		if( dryRun )

+ 2 - 1
client/geometry_utils.js

@@ -605,7 +605,8 @@ GeometryUtils = function(){
 				insertRequests.forEach(
 					function(r)
 					{
-						toBeInserted[r['reqData']['dest']] = r['reqData']['src'];
+                        if ('reqData' in r)
+                            toBeInserted[r['reqData']['dest']] = r['reqData']['src'];
 					});
 			}