|
15 | 15 | */
|
16 | 16 | (function( $, undefined ) {
|
17 | 17 |
|
18 |
| -/*jshint loopfunc: true */ |
19 |
| - |
20 | 18 | function isOverAxis( x, reference, size ) {
|
21 | 19 | return ( x > reference ) && ( x < ( reference + size ) );
|
22 | 20 | }
|
@@ -629,10 +627,11 @@ $.widget("ui.sortable", $.ui.mouse, {
|
629 | 627 |
|
630 | 628 | queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);
|
631 | 629 |
|
| 630 | + function addItems() { |
| 631 | + items.push( this ); |
| 632 | + } |
632 | 633 | for (i = queries.length - 1; i >= 0; i--){
|
633 |
| - queries[i][0].each(function() { |
634 |
| - items.push(this); |
635 |
| - }); |
| 634 | + queries[i][0].each( addItems ); |
636 | 635 | }
|
637 | 636 |
|
638 | 637 | return $(items);
|
@@ -1190,12 +1189,17 @@ $.widget("ui.sortable", $.ui.mouse, {
|
1190 | 1189 |
|
1191 | 1190 |
|
1192 | 1191 | //Post events to containers
|
| 1192 | + function delayEvent( type, instance, container ) { |
| 1193 | + return function( event ) { |
| 1194 | + container._trigger( type, event, instance._uiHash( instance ) ); |
| 1195 | + }; |
| 1196 | + } |
1193 | 1197 | for (i = this.containers.length - 1; i >= 0; i--){
|
1194 |
| - if(!noPropagation) { |
1195 |
| - delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); }; }).call(this, this.containers[i])); |
| 1198 | + if (!noPropagation) { |
| 1199 | + delayedTriggers.push( delayEvent( "deactivate", this, this.containers[ i ] ) ); |
1196 | 1200 | }
|
1197 | 1201 | if(this.containers[i].containerCache.over) {
|
1198 |
| - delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); }; }).call(this, this.containers[i])); |
| 1202 | + delayedTriggers.push( delayEvent( "out", this, this.containers[ i ] ) ); |
1199 | 1203 | this.containers[i].containerCache.over = 0;
|
1200 | 1204 | }
|
1201 | 1205 | }
|
|
0 commit comments