mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Sortable: Using the new core intersectHeight/intersectWidth methods.
This commit is contained in:
parent
91377e4e5c
commit
acf15c4f08
@ -156,19 +156,12 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
|
||||
|
||||
_intersectsWithEdge: function(item) {
|
||||
var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
|
||||
var helperHeight = this.helperProportions.height, helperWidth = this.helperProportions.width;
|
||||
var helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
|
||||
var itemHeight = item.height, itemWidth = item.width;
|
||||
var itemTop = item.top, itemLeft = item.left;
|
||||
|
||||
var isOverElementHeight =
|
||||
((helperTop + dyClick) > itemTop) &&
|
||||
((helperTop + dyClick) < (itemTop + itemHeight));
|
||||
|
||||
var isOverElementWidth =
|
||||
((helperLeft + dxClick) > itemLeft) &&
|
||||
((helperLeft + dxClick) < (itemLeft + itemWidth));
|
||||
|
||||
var isOverElementHeight = $.ui.intersectHeight(helperTop + dyClick, itemTop, itemHeight);
|
||||
var isOverElementWidth = $.ui.intersectWidth(helperLeft + dxClick, itemLeft, itemWidth);
|
||||
var isOverElement = isOverElementHeight && isOverElementWidth;
|
||||
var verticalDirection = this._getDragVerticalDirection();
|
||||
var horizontalDirection = this._getDragHorizontalDirection();
|
||||
|
Loading…
Reference in New Issue
Block a user