1515 */
1616( function ( $ , undefined ) {
1717
18- function isOverAxis ( x , reference , size ) {
19- return ( x >= reference ) && ( x < ( reference + size ) ) ;
20- }
21-
22- function isFloating ( item ) {
23- return ( / l e f t | r i g h t / ) . test ( item . css ( "float" ) ) || ( / i n l i n e | t a b l e - c e l l / ) . test ( item . css ( "display" ) ) ;
24- }
25-
2618$ . widget ( "ui.sortable" , $ . ui . mouse , {
2719 version : "@VERSION" ,
2820 widgetEventPrefix : "sort" ,
@@ -65,6 +57,15 @@ $.widget("ui.sortable", $.ui.mouse, {
6557 stop : null ,
6658 update : null
6759 } ,
60+
61+ _isOverAxis : function ( x , reference , size ) {
62+ return ( x >= reference ) && ( x < ( reference + size ) ) ;
63+ } ,
64+
65+ _isFloating : function ( item ) {
66+ return ( / l e f t | r i g h t / ) . test ( item . css ( "float" ) ) || ( / i n l i n e | t a b l e - c e l l / ) . test ( item . css ( "display" ) ) ;
67+ } ,
68+
6869 _create : function ( ) {
6970
7071 var o = this . options ;
@@ -75,7 +76,7 @@ $.widget("ui.sortable", $.ui.mouse, {
7576 this . refresh ( ) ;
7677
7778 //Let's determine if the items are being displayed horizontally
78- this . floating = this . items . length ? o . axis === "x" || isFloating ( this . items [ 0 ] . item ) : false ;
79+ this . floating = this . items . length ? o . axis === "x" || this . _isFloating ( this . items [ 0 ] . item ) : false ;
7980
8081 //Let's determine the parent's offset
8182 this . offset = this . element . offset ( ) ;
@@ -554,8 +555,8 @@ $.widget("ui.sortable", $.ui.mouse, {
554555
555556 _intersectsWithPointer : function ( item ) {
556557
557- var isOverElementHeight = ( this . options . axis === "x" ) || isOverAxis ( this . positionAbs . top + this . offset . click . top , item . top , item . height ) ,
558- isOverElementWidth = ( this . options . axis === "y" ) || isOverAxis ( this . positionAbs . left + this . offset . click . left , item . left , item . width ) ,
558+ var isOverElementHeight = ( this . options . axis === "x" ) || this . _isOverAxis ( this . positionAbs . top + this . offset . click . top , item . top , item . height ) ,
559+ isOverElementWidth = ( this . options . axis === "y" ) || this . _isOverAxis ( this . positionAbs . left + this . offset . click . left , item . left , item . width ) ,
559560 isOverElement = isOverElementHeight && isOverElementWidth ,
560561 verticalDirection = this . _getDragVerticalDirection ( ) ,
561562 horizontalDirection = this . _getDragHorizontalDirection ( ) ;
@@ -572,8 +573,8 @@ $.widget("ui.sortable", $.ui.mouse, {
572573
573574 _intersectsWithSides : function ( item ) {
574575
575- var isOverBottomHalf = isOverAxis ( this . positionAbs . top + this . offset . click . top , item . top + ( item . height / 2 ) , item . height ) ,
576- isOverRightHalf = isOverAxis ( this . positionAbs . left + this . offset . click . left , item . left + ( item . width / 2 ) , item . width ) ,
576+ var isOverBottomHalf = this . _isOverAxis ( this . positionAbs . top + this . offset . click . top , item . top + ( item . height / 2 ) , item . height ) ,
577+ isOverRightHalf = this . _isOverAxis ( this . positionAbs . left + this . offset . click . left , item . left + ( item . width / 2 ) , item . width ) ,
577578 verticalDirection = this . _getDragVerticalDirection ( ) ,
578579 horizontalDirection = this . _getDragHorizontalDirection ( ) ;
579580
@@ -846,7 +847,7 @@ $.widget("ui.sortable", $.ui.mouse, {
846847 //When entering a new container, we will find the item with the least distance and append our item near it
847848 dist = 10000 ;
848849 itemWithLeastDistance = null ;
849- floating = innermostContainer . floating || isFloating ( this . currentItem ) ;
850+ floating = innermostContainer . floating || this . _isFloating ( this . currentItem ) ;
850851 posProperty = floating ? "left" : "top" ;
851852 sizeProperty = floating ? "width" : "height" ;
852853 base = this . positionAbs [ posProperty ] + this . offset . click [ posProperty ] ;
@@ -857,7 +858,7 @@ $.widget("ui.sortable", $.ui.mouse, {
857858 if ( this . items [ j ] . item [ 0 ] === this . currentItem [ 0 ] ) {
858859 continue ;
859860 }
860- if ( floating && ! isOverAxis ( this . positionAbs . top + this . offset . click . top , this . items [ j ] . top , this . items [ j ] . height ) ) {
861+ if ( floating && ! this . _isOverAxis ( this . positionAbs . top + this . offset . click . top , this . items [ j ] . top , this . items [ j ] . height ) ) {
861862 continue ;
862863 }
863864 cur = this . items [ j ] . item . offset ( ) [ posProperty ] ;
0 commit comments