* Return the first node that intercepts/collides with the given node or area. * Used for collision detection during drag and drop operations. * * @param skip the node to skip in collision detection (usually the node being moved) * @param area the area to check for collisions (defaults to
(skip: GridStackNode, area = skip, skip2?: GridStackNode)
| 180 | * } |
| 181 | */ |
| 182 | public collide(skip: GridStackNode, area = skip, skip2?: GridStackNode): GridStackNode | undefined { |
| 183 | const skipId = skip._id; |
| 184 | const skip2Id = skip2?._id; |
| 185 | return this.nodes.find(n => n._id !== skipId && n._id !== skip2Id && Utils.isIntercepted(n, area)); |
| 186 | } |
| 187 | /** |
| 188 | * Return all nodes that intercept/collide with the given node or area. |
| 189 | * Similar to collide() but returns all colliding nodes instead of just the first. |
no test coverage detected