Skip to content

Commit 3ec0c2e

Browse files
committed
Core: Removed $.ui.isOver() and $.ui.isOverAxis(). Fixes #8891 - Remove $.ui.isOver() and $.ui.isOverAxis().
1 parent b239298 commit 3ec0c2e

File tree

3 files changed

+13
-15
lines changed

3 files changed

+13
-15
lines changed

ui/jquery.ui.core.js

-10
Original file line numberDiff line numberDiff line change
@@ -313,16 +313,6 @@ $.extend( $.ui, {
313313
has = ( el[ scroll ] > 0 );
314314
el[ scroll ] = 0;
315315
return has;
316-
},
317-
318-
// these are odd functions, fix the API or move into individual plugins
319-
isOverAxis: function( x, reference, size ) {
320-
//Determines when x coordinate is over "b" element axis
321-
return ( x > reference ) && ( x < ( reference + size ) );
322-
},
323-
isOver: function( y, x, top, left, height, width ) {
324-
//Determines when x, y coordinates is over "b" element
325-
return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width );
326316
}
327317
});
328318

ui/jquery.ui.droppable.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
*/
1717
(function( $, undefined ) {
1818

19+
function isOverAxis( x, reference, size ) {
20+
return ( x > reference ) && ( x < ( reference + size ) );
21+
}
22+
1923
$.widget("ui.droppable", {
2024
version: "@VERSION",
2125
widgetEventPrefix: "drop",
@@ -203,7 +207,7 @@ $.ui.intersect = function(draggable, droppable, toleranceMode) {
203207
case 'pointer':
204208
draggableLeft = ((draggable.positionAbs || draggable.position.absolute).left + (draggable.clickOffset || draggable.offset.click).left);
205209
draggableTop = ((draggable.positionAbs || draggable.position.absolute).top + (draggable.clickOffset || draggable.offset.click).top);
206-
return $.ui.isOver(draggableTop, draggableLeft, t, l, droppable.proportions.height, droppable.proportions.width);
210+
return isOverAxis( draggableTop, t, droppable.proportions.height ) && isOverAxis( draggableLeft, l, droppable.proportions.width )
207211
case 'touch':
208212
return (
209213
(y1 >= t && y1 <= b) || // Top edge touching

ui/jquery.ui.sortable.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717

1818
/*jshint loopfunc: true */
1919

20+
function isOverAxis( x, reference, size ) {
21+
return ( x > reference ) && ( x < ( reference + size ) );
22+
}
23+
2024
$.widget("ui.sortable", $.ui.mouse, {
2125
version: "@VERSION",
2226
widgetEventPrefix: "sort",
@@ -536,8 +540,8 @@ $.widget("ui.sortable", $.ui.mouse, {
536540

537541
_intersectsWithPointer: function(item) {
538542

539-
var isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
540-
isOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
543+
var isOverElementHeight = (this.options.axis === 'x') || isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
544+
isOverElementWidth = (this.options.axis === 'y') || isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
541545
isOverElement = isOverElementHeight && isOverElementWidth,
542546
verticalDirection = this._getDragVerticalDirection(),
543547
horizontalDirection = this._getDragHorizontalDirection();
@@ -554,8 +558,8 @@ $.widget("ui.sortable", $.ui.mouse, {
554558

555559
_intersectsWithSides: function(item) {
556560

557-
var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
558-
isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
561+
var isOverBottomHalf = isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
562+
isOverRightHalf = isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
559563
verticalDirection = this._getDragVerticalDirection(),
560564
horizontalDirection = this._getDragHorizontalDirection();
561565

0 commit comments

Comments
 (0)