aboutsummaryrefslogtreecommitdiffstats
path: root/ui/ui.sortable.js
diff options
context:
space:
mode:
authorPaul Bakaus <paul.bakaus@googlemail.com>2008-11-19 09:54:53 +0000
committerPaul Bakaus <paul.bakaus@googlemail.com>2008-11-19 09:54:53 +0000
commit2a6a3561092a3c34d3f5c6b759e4af3ec01fcf0f (patch)
tree1a61484429b166168a39d6275af430680a0bc9a3 /ui/ui.sortable.js
parent8306e62887be2bcc70984fd3b3b6c9d8158843cf (diff)
downloadjquery-ui-2a6a3561092a3c34d3f5c6b759e4af3ec01fcf0f.tar.gz
jquery-ui-2a6a3561092a3c34d3f5c6b759e4af3ec01fcf0f.zip
sortable: removed ui.element and ui.options from the UI object, corrected the callback for the items option, now includes event if applicable
Diffstat (limited to 'ui/ui.sortable.js')
-rw-r--r--ui/ui.sortable.js14
1 files changed, 6 insertions, 8 deletions
diff --git a/ui/ui.sortable.js b/ui/ui.sortable.js
index 4b4d928ef..438ebe159 100644
--- a/ui/ui.sortable.js
+++ b/ui/ui.sortable.js
@@ -40,8 +40,6 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
placeholder: self.placeholder || $([]),
position: self.position,
absolutePosition: self.positionAbs,
- options: this.options,
- element: this.element,
item: self.currentItem,
sender: inst ? inst.element : null
};
@@ -206,8 +204,8 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
return direction;
},
- refresh: function() {
- this._refreshItems();
+ refresh: function(event) {
+ this._refreshItems(event);
this.refreshPositions();
},
@@ -256,13 +254,13 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
},
- _refreshItems: function() {
+ _refreshItems: function(event) {
this.items = [];
this.containers = [this];
var items = this.items;
var self = this;
- var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element), this]];
+ var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]];
if(this.options.connectWith) {
for (var i = this.options.connectWith.length - 1; i >= 0; i--){
@@ -270,7 +268,7 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
for (var j = cur.length - 1; j >= 0; j--){
var inst = $.data(cur[j], 'sortable');
if(inst && inst != this && !inst.options.disabled) {
- queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element), inst]);
+ queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
this.containers.push(inst);
}
};
@@ -449,7 +447,7 @@ $.widget("ui.sortable", $.extend({}, $.ui.mouse, {
if(this.options.disabled || this.options.type == 'static') return false;
//We have to refresh the items data once first
- this._refreshItems();
+ this._refreshItems(event);
//Find out if the clicked node (or one of its parents) is a actual item in this.items
var currentItem = null, self = this, nodes = $(event.target).parents().each(function() {