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) {
|
_intersectsWithEdge: function(item) {
|
||||||
var dyClick = this.offset.click.top, dxClick = this.offset.click.left;
|
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 helperTop = this.positionAbs.top, helperLeft = this.positionAbs.left;
|
||||||
var itemHeight = item.height, itemWidth = item.width;
|
var itemHeight = item.height, itemWidth = item.width;
|
||||||
var itemTop = item.top, itemLeft = item.left;
|
var itemTop = item.top, itemLeft = item.left;
|
||||||
|
|
||||||
var isOverElementHeight =
|
var isOverElementHeight = $.ui.intersectHeight(helperTop + dyClick, itemTop, itemHeight);
|
||||||
((helperTop + dyClick) > itemTop) &&
|
var isOverElementWidth = $.ui.intersectWidth(helperLeft + dxClick, itemLeft, itemWidth);
|
||||||
((helperTop + dyClick) < (itemTop + itemHeight));
|
|
||||||
|
|
||||||
var isOverElementWidth =
|
|
||||||
((helperLeft + dxClick) > itemLeft) &&
|
|
||||||
((helperLeft + dxClick) < (itemLeft + itemWidth));
|
|
||||||
|
|
||||||
var isOverElement = isOverElementHeight && isOverElementWidth;
|
var isOverElement = isOverElementHeight && isOverElementWidth;
|
||||||
var verticalDirection = this._getDragVerticalDirection();
|
var verticalDirection = this._getDragVerticalDirection();
|
||||||
var horizontalDirection = this._getDragHorizontalDirection();
|
var horizontalDirection = this._getDragHorizontalDirection();
|
||||||
|
Loading…
Reference in New Issue
Block a user