Skip to content

Commit d0cac09

Browse files
committed
Sortable: Whitespace.
1 parent a0fb2c2 commit d0cac09

File tree

1 file changed

+43
-43
lines changed

1 file changed

+43
-43
lines changed

ui/jquery.ui.sortable.js

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ $.widget("ui.sortable", $.ui.mouse, {
5959

6060
//Initialize mouse events for interaction
6161
this._mouseInit();
62-
62+
6363
//We're ready to go
6464
this.ready = true
6565

@@ -79,7 +79,7 @@ $.widget("ui.sortable", $.ui.mouse, {
7979
_setOption: function(key, value){
8080
if ( key === "disabled" ) {
8181
this.options[ key ] = value;
82-
82+
8383
this.widget().toggleClass( "ui-sortable-disabled", !!value );
8484
} else {
8585
// Don't call widget base _setOption for disable as it adds ui-state-disabled class
@@ -519,7 +519,7 @@ $.widget("ui.sortable", $.ui.mouse, {
519519
? [options.connectWith]
520520
: options.connectWith;
521521
},
522-
522+
523523
_getItemsAsjQuery: function(connected) {
524524

525525
var self = this;
@@ -692,71 +692,71 @@ $.widget("ui.sortable", $.ui.mouse, {
692692
},
693693

694694
_contactContainers: function(event) {
695-
696-
// get innermost container that intersects with item
697-
var innermostContainer = null, innermostIndex = null;
698-
699-
695+
696+
// get innermost container that intersects with item
697+
var innermostContainer = null, innermostIndex = null;
698+
699+
700700
for (var i = this.containers.length - 1; i >= 0; i--){
701701

702-
// never consider a container that's located within the item itself
702+
// never consider a container that's located within the item itself
703703
if($.contains(this.currentItem[0], this.containers[i].element[0]))
704704
continue;
705705

706706
if(this._intersectsWith(this.containers[i].containerCache)) {
707707

708-
// if we've already found a container and it's more "inner" than this, then continue
708+
// if we've already found a container and it's more "inner" than this, then continue
709709
if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0]))
710710
continue;
711711

712-
innermostContainer = this.containers[i];
712+
innermostContainer = this.containers[i];
713713
innermostIndex = i;
714-
714+
715715
} else {
716-
// container doesn't intersect. trigger "out" event if necessary
716+
// container doesn't intersect. trigger "out" event if necessary
717717
if(this.containers[i].containerCache.over) {
718718
this.containers[i]._trigger("out", event, this._uiHash(this));
719719
this.containers[i].containerCache.over = 0;
720720
}
721721
}
722722

723723
}
724-
725-
// if no intersecting containers found, return
726-
if(!innermostContainer) return;
724+
725+
// if no intersecting containers found, return
726+
if(!innermostContainer) return;
727727

728728
// move the item into the container if it's not there already
729729
if(this.containers.length === 1) {
730730
this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
731731
this.containers[innermostIndex].containerCache.over = 1;
732-
} else if(this.currentContainer != this.containers[innermostIndex]) {
733-
734-
//When entering a new container, we will find the item with the least distance and append our item near it
735-
var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[innermostIndex].floating ? 'left' : 'top'];
736-
for (var j = this.items.length - 1; j >= 0; j--) {
737-
if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue;
738-
var cur = this.items[j][this.containers[innermostIndex].floating ? 'left' : 'top'];
739-
if(Math.abs(cur - base) < dist) {
740-
dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];
741-
}
742-
}
743-
744-
if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled
745-
return;
746-
747-
this.currentContainer = this.containers[innermostIndex];
748-
itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
749-
this._trigger("change", event, this._uiHash());
750-
this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
751-
752-
//Update the placeholder
753-
this.options.placeholder.update(this.currentContainer, this.placeholder);
754-
755-
this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
732+
} else if(this.currentContainer != this.containers[innermostIndex]) {
733+
734+
//When entering a new container, we will find the item with the least distance and append our item near it
735+
var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[innermostIndex].floating ? 'left' : 'top'];
736+
for (var j = this.items.length - 1; j >= 0; j--) {
737+
if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue;
738+
var cur = this.items[j][this.containers[innermostIndex].floating ? 'left' : 'top'];
739+
if(Math.abs(cur - base) < dist) {
740+
dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];
741+
}
742+
}
743+
744+
if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled
745+
return;
746+
747+
this.currentContainer = this.containers[innermostIndex];
748+
itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
749+
this._trigger("change", event, this._uiHash());
750+
this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
751+
752+
//Update the placeholder
753+
this.options.placeholder.update(this.currentContainer, this.placeholder);
754+
755+
this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
756756
this.containers[innermostIndex].containerCache.over = 1;
757-
}
758-
759-
757+
}
758+
759+
760760
},
761761

762762
_createHelper: function(event) {

0 commit comments

Comments
 (0)