|
1 | | -import DragZone from './DragZone.mjs'; |
2 | | -import NeoArray from '../../util/Array.mjs'; |
3 | | -import VDomUtil from '../../util/VDom.mjs'; |
| 1 | +import DragZone from './DragZone.mjs'; |
| 2 | +import NeoArray from '../../util/Array.mjs'; |
| 3 | +import Rectangle from '../../util/Rectangle.mjs'; |
| 4 | +import VDomUtil from '../../util/VDom.mjs'; |
4 | 5 |
|
5 | 6 | /** |
6 | 7 | * @class Neo.draggable.container.SortZone |
@@ -100,6 +101,11 @@ class SortZone extends DragZone { |
100 | 101 | * @protected |
101 | 102 | */ |
102 | 103 | isOverDragging = false |
| 104 | + /** |
| 105 | + * @member {Boolean} isWindowDragging=false |
| 106 | + * @protected |
| 107 | + */ |
| 108 | + isWindowDragging = false |
103 | 109 |
|
104 | 110 | /** |
105 | 111 | * Toggles the neo-draggable cls on items inside our owner. |
@@ -207,6 +213,27 @@ class SortZone extends DragZone { |
207 | 213 | return |
208 | 214 | } |
209 | 215 |
|
| 216 | + // Phase 3: Dynamic Proxy Transitioning |
| 217 | + if (this.dragProxy && !this.isWindowDragging) { |
| 218 | + const proxyRect = await this.dragProxy.getDomRect(); |
| 219 | + |
| 220 | + if (proxyRect) { |
| 221 | + const boundaryRect = this.boundaryContainerRect; |
| 222 | + const intersection = Rectangle.getIntersection(proxyRect, boundaryRect); |
| 223 | + const proxyArea = proxyRect.width * proxyRect.height; |
| 224 | + const intersectionArea = intersection ? intersection.width * intersection.height : 0; |
| 225 | + |
| 226 | + if (proxyArea > 0 && (intersectionArea / proxyArea) < 0.5) { |
| 227 | + this.isWindowDragging = true; // Set flag to prevent re-entry |
| 228 | + |
| 229 | + this.fire('dragBoundaryExit', { |
| 230 | + draggedItem: Neo.getComponent(this.dragElement.id) |
| 231 | + }); |
| 232 | + return; // Stop further processing in onDragMove |
| 233 | + } |
| 234 | + } |
| 235 | + } |
| 236 | + |
210 | 237 | let me = this, |
211 | 238 | {clientX, clientY} = data, |
212 | 239 | index = me.currentIndex, |
|
0 commit comments