@@ -63,13 +63,11 @@ $.widget("ui.sortable", $.ui.mouse, {
63
63
64
64
destroy : function ( ) {
65
65
this . element
66
- . removeClass ( "ui-sortable ui-sortable-disabled" )
67
- . removeData ( "sortable" )
68
- . unbind ( ".sortable" ) ;
66
+ . removeClass ( "ui-sortable ui-sortable-disabled" ) ;
69
67
this . _mouseDestroy ( ) ;
70
68
71
69
for ( var i = this . items . length - 1 ; i >= 0 ; i -- )
72
- this . items [ i ] . item . removeData ( "sortable -item") ;
70
+ this . items [ i ] . item . removeData ( this . widgetName + " -item") ;
73
71
74
72
return this ;
75
73
} ,
@@ -86,6 +84,7 @@ $.widget("ui.sortable", $.ui.mouse, {
86
84
} ,
87
85
88
86
_mouseCapture : function ( event , overrideHandle ) {
87
+ var that = this ;
89
88
90
89
if ( this . reverting ) {
91
90
return false ;
@@ -98,12 +97,12 @@ $.widget("ui.sortable", $.ui.mouse, {
98
97
99
98
//Find out if the clicked node (or one of its parents) is a actual item in this.items
100
99
var currentItem = null , self = this , nodes = $ ( event . target ) . parents ( ) . each ( function ( ) {
101
- if ( $ . data ( this , 'sortable -item') == self ) {
100
+ if ( $ . data ( this , that . widgetName + ' -item') == self ) {
102
101
currentItem = $ ( this ) ;
103
102
return false ;
104
103
}
105
104
} ) ;
106
- if ( $ . data ( event . target , 'sortable -item') == self ) currentItem = $ ( event . target ) ;
105
+ if ( $ . data ( event . target , that . widgetName + ' -item') == self ) currentItem = $ ( event . target ) ;
107
106
108
107
if ( ! currentItem ) return false ;
109
108
if ( this . options . handle && ! overrideHandle ) {
@@ -528,7 +527,7 @@ $.widget("ui.sortable", $.ui.mouse, {
528
527
for ( var i = connectWith . length - 1 ; i >= 0 ; i -- ) {
529
528
var cur = $ ( connectWith [ i ] ) ;
530
529
for ( var j = cur . length - 1 ; j >= 0 ; j -- ) {
531
- var inst = $ . data ( cur [ j ] , 'sortable' ) ;
530
+ var inst = $ . data ( cur [ j ] , this . widgetName ) ;
532
531
if ( inst && inst != this && ! inst . options . disabled ) {
533
532
queries . push ( [ $ . isFunction ( inst . options . items ) ? inst . options . items . call ( inst . element ) : $ ( inst . options . items , inst . element ) . not ( ".ui-sortable-helper" ) . not ( '.ui-sortable-placeholder' ) , inst ] ) ;
534
533
}
@@ -550,7 +549,7 @@ $.widget("ui.sortable", $.ui.mouse, {
550
549
551
550
_removeCurrentsFromItems : function ( ) {
552
551
553
- var list = this . currentItem . find ( ":data(sortable -item)" ) ;
552
+ var list = this . currentItem . find ( ":data(" + this . widgetName + " -item)") ;
554
553
555
554
for ( var i = 0 ; i < this . items . length ; i ++ ) {
556
555
@@ -576,7 +575,7 @@ $.widget("ui.sortable", $.ui.mouse, {
576
575
for ( var i = connectWith . length - 1 ; i >= 0 ; i -- ) {
577
576
var cur = $ ( connectWith [ i ] ) ;
578
577
for ( var j = cur . length - 1 ; j >= 0 ; j -- ) {
579
- var inst = $ . data ( cur [ j ] , 'sortable' ) ;
578
+ var inst = $ . data ( cur [ j ] , this . widgetName ) ;
580
579
if ( inst && inst != this && ! inst . options . disabled ) {
581
580
queries . push ( [ $ . isFunction ( inst . options . items ) ? inst . options . items . call ( inst . element [ 0 ] , event , { item : this . currentItem } ) : $ ( inst . options . items , inst . element ) , inst ] ) ;
582
581
this . containers . push ( inst ) ;
@@ -592,7 +591,7 @@ $.widget("ui.sortable", $.ui.mouse, {
592
591
for ( var j = 0 , queriesLength = _queries . length ; j < queriesLength ; j ++ ) {
593
592
var item = $ ( _queries [ j ] ) ;
594
593
595
- item . data ( 'sortable -item', targetData ) ; // Data for target checking (mouse manager)
594
+ item . data ( this . widgetName + ' -item', targetData ) ; // Data for target checking (mouse manager)
596
595
597
596
items . push ( {
598
597
item : item ,
0 commit comments