mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Core: Removed $.ui.isOver() and $.ui.isOverAxis(). Fixes #8891 - Remove $.ui.isOver() and $.ui.isOverAxis().
This commit is contained in:
parent
b239298946
commit
3ec0c2e572
10
ui/jquery.ui.core.js
vendored
10
ui/jquery.ui.core.js
vendored
@ -313,16 +313,6 @@ $.extend( $.ui, {
|
|||||||
has = ( el[ scroll ] > 0 );
|
has = ( el[ scroll ] > 0 );
|
||||||
el[ scroll ] = 0;
|
el[ scroll ] = 0;
|
||||||
return has;
|
return has;
|
||||||
},
|
|
||||||
|
|
||||||
// these are odd functions, fix the API or move into individual plugins
|
|
||||||
isOverAxis: function( x, reference, size ) {
|
|
||||||
//Determines when x coordinate is over "b" element axis
|
|
||||||
return ( x > reference ) && ( x < ( reference + size ) );
|
|
||||||
},
|
|
||||||
isOver: function( y, x, top, left, height, width ) {
|
|
||||||
//Determines when x, y coordinates is over "b" element
|
|
||||||
return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width );
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
6
ui/jquery.ui.droppable.js
vendored
6
ui/jquery.ui.droppable.js
vendored
@ -16,6 +16,10 @@
|
|||||||
*/
|
*/
|
||||||
(function( $, undefined ) {
|
(function( $, undefined ) {
|
||||||
|
|
||||||
|
function isOverAxis( x, reference, size ) {
|
||||||
|
return ( x > reference ) && ( x < ( reference + size ) );
|
||||||
|
}
|
||||||
|
|
||||||
$.widget("ui.droppable", {
|
$.widget("ui.droppable", {
|
||||||
version: "@VERSION",
|
version: "@VERSION",
|
||||||
widgetEventPrefix: "drop",
|
widgetEventPrefix: "drop",
|
||||||
@ -203,7 +207,7 @@ $.ui.intersect = function(draggable, droppable, toleranceMode) {
|
|||||||
case 'pointer':
|
case 'pointer':
|
||||||
draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left);
|
draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left);
|
||||||
draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top);
|
draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top);
|
||||||
return $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);
|
return isOverAxis( draggableTop, t, droppable.proportions.height ) && isOverAxis( draggableLeft, l, droppable.proportions.width )
|
||||||
case 'touch':
|
case 'touch':
|
||||||
return (
|
return (
|
||||||
(y1 >= t && y1 <= b) || // Top edge touching
|
(y1 >= t && y1 <= b) || // Top edge touching
|
||||||
|
12
ui/jquery.ui.sortable.js
vendored
12
ui/jquery.ui.sortable.js
vendored
@ -17,6 +17,10 @@
|
|||||||
|
|
||||||
/*jshint loopfunc: true */
|
/*jshint loopfunc: true */
|
||||||
|
|
||||||
|
function isOverAxis( x, reference, size ) {
|
||||||
|
return ( x > reference ) && ( x < ( reference + size ) );
|
||||||
|
}
|
||||||
|
|
||||||
$.widget("ui.sortable", $.ui.mouse, {
|
$.widget("ui.sortable", $.ui.mouse, {
|
||||||
version: "@VERSION",
|
version: "@VERSION",
|
||||||
widgetEventPrefix: "sort",
|
widgetEventPrefix: "sort",
|
||||||
@ -536,8 +540,8 @@ $.widget("ui.sortable", $.ui.mouse, {
|
|||||||
|
|
||||||
_intersectsWithPointer: function(item) {
|
_intersectsWithPointer: function(item) {
|
||||||
|
|
||||||
var isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
|
var isOverElementHeight = (this.options.axis === 'x') || isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
|
||||||
isOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
|
isOverElementWidth = (this.options.axis === 'y') || isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
|
||||||
isOverElement = isOverElementHeight && isOverElementWidth,
|
isOverElement = isOverElementHeight && isOverElementWidth,
|
||||||
verticalDirection = this._getDragVerticalDirection(),
|
verticalDirection = this._getDragVerticalDirection(),
|
||||||
horizontalDirection = this._getDragHorizontalDirection();
|
horizontalDirection = this._getDragHorizontalDirection();
|
||||||
@ -554,8 +558,8 @@ $.widget("ui.sortable", $.ui.mouse, {
|
|||||||
|
|
||||||
_intersectsWithSides: function(item) {
|
_intersectsWithSides: function(item) {
|
||||||
|
|
||||||
var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
|
var isOverBottomHalf = isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
|
||||||
isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
|
isOverRightHalf = isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
|
||||||
verticalDirection = this._getDragVerticalDirection(),
|
verticalDirection = this._getDragVerticalDirection(),
|
||||||
horizontalDirection = this._getDragHorizontalDirection();
|
horizontalDirection = this._getDragHorizontalDirection();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user