Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Core: Removed $.ui.isOver() and $.ui.isOverAxis(). Fixes #8891 - Remo…

…ve $.ui.isOver() and $.ui.isOverAxis().
  • Loading branch information...
commit 3ec0c2e5728da9b9b9955dfe18073d3985e61a52 1 parent b239298
Scott González scottgonzalez authored
10 ui/jquery.ui.core.js
View
@@ -313,16 +313,6 @@ $.extend( $.ui, {
has = ( el[ scroll ] > 0 );
el[ scroll ] = 0;
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
View
@@ -16,6 +16,10 @@
*/
(function( $, undefined ) {
+function isOverAxis( x, reference, size ) {
+ return ( x > reference ) && ( x < ( reference + size ) );
+}
+
$.widget("ui.droppable", {
version: "@VERSION",
widgetEventPrefix: "drop",
@@ -203,7 +207,7 @@ $.ui.intersect = function(draggable, droppable, toleranceMode) {
case 'pointer':
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);
- 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':
return (
(y1 >= t && y1 <= b) || // Top edge touching
12 ui/jquery.ui.sortable.js
View
@@ -17,6 +17,10 @@
/*jshint loopfunc: true */
+function isOverAxis( x, reference, size ) {
+ return ( x > reference ) && ( x < ( reference + size ) );
+}
+
$.widget("ui.sortable", $.ui.mouse, {
version: "@VERSION",
widgetEventPrefix: "sort",
@@ -536,8 +540,8 @@ $.widget("ui.sortable", $.ui.mouse, {
_intersectsWithPointer: function(item) {
- var isOverElementHeight = (this.options.axis === 'x') || $.ui.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),
+ var isOverElementHeight = (this.options.axis === 'x') || isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
+ isOverElementWidth = (this.options.axis === 'y') || isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
isOverElement = isOverElementHeight && isOverElementWidth,
verticalDirection = this._getDragVerticalDirection(),
horizontalDirection = this._getDragHorizontalDirection();
@@ -554,8 +558,8 @@ $.widget("ui.sortable", $.ui.mouse, {
_intersectsWithSides: function(item) {
- var isOverBottomHalf = $.ui.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),
+ var isOverBottomHalf = isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
+ isOverRightHalf = isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
verticalDirection = this._getDragVerticalDirection(),
horizontalDirection = this._getDragHorizontalDirection();
Please sign in to comment.
Something went wrong with that request. Please try again.