File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
frontend/src/components/panels Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 362362 // Dragging to the empty space below all layers
363363 let lastLayer = treeChildren [treeChildren .length - 1 ];
364364 if (lastLayer .getBoundingClientRect ().bottom < clientY ) {
365- const numberRootLayers = layers .filter ((layer ) => layer .entry .depth === 1 ).length ;
366- insertParentId = undefined ;
367- insertDepth = 0 ;
368- insertIndex = numberRootLayers ;
369- markerHeight = lastLayer .getBoundingClientRect ().bottom - layerPanelTop ;
365+ const lastLayerIndexAttr = lastLayer .getAttribute (" data-index" );
366+ if (lastLayerIndexAttr ) {
367+ const { folderIndex, entry : lastEntry } = layers [parseInt (lastLayerIndexAttr , 10 )];
368+
369+ if (lastEntry .depth === 1 ) {
370+ insertParentId = undefined ;
371+ } else {
372+ insertParentId = lastEntry .parentId ;
373+ }
374+ insertIndex = folderIndex + 1 ;
375+ markerHeight = lastLayer .getBoundingClientRect ().bottom - layerPanel .getBoundingClientRect ().top ;
376+ }
370377 }
371378 }
372379
You can’t perform that action at this time.
0 commit comments