aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/draggable.js5
-rw-r--r--ui/ui.core.js2
-rw-r--r--ui/ui.sortable.js6
3 files changed, 4 insertions, 9 deletions
diff --git a/tests/draggable.js b/tests/draggable.js
index 45b907d78..d428a21ff 100644
--- a/tests/draggable.js
+++ b/tests/draggable.js
@@ -225,11 +225,6 @@ test("{ cancel: ? }, unexpected", function() {
el = $("#draggable2").draggable({ cancel: val });
drag(el, 50, 50);
var expected = [50, 50];
- switch(key) {
- case "true":
- expected = [0, 0]
- break;
- }
moved(expected[0], expected[1], "cancel: " + key);
el.draggable("destroy");
})
diff --git a/ui/ui.core.js b/ui/ui.core.js
index d7a28c967..b20e492e4 100644
--- a/ui/ui.core.js
+++ b/ui/ui.core.js
@@ -198,7 +198,7 @@ $.ui.mouse = {
var self = this,
btnIsLeft = (e.which == 1),
- elIsCancel = ($(e.target).is(this.options.cancel));
+ elIsCancel = (typeof this.options.cancel == "string" ? $(e.target).is(this.options.cancel) : false);
if (!btnIsLeft || elIsCancel) {
return true;
}
diff --git a/ui/ui.sortable.js b/ui/ui.sortable.js
index 84eb0df93..9718dd1bc 100644
--- a/ui/ui.sortable.js
+++ b/ui/ui.sortable.js
@@ -65,9 +65,7 @@ $.widget("ui.sortable", $.extend($.ui.mouse, {
if(!noPropagation) this.element.triggerHandler(n == "sort" ? n : "sort"+n, [e, this.ui(inst)], this.options[n]);
},
serialize: function(o) {
-
-
-
+
var items = ($.isFunction(this.options.items) ? this.options.items.call(this.element) : $(this.options.items, this.element)).not('.ui-sortable-helper'); //Only the items of the sortable itself
var str = []; o = o || {};
@@ -80,11 +78,13 @@ $.widget("ui.sortable", $.extend($.ui.mouse, {
},
toArray: function(attr) {
+
var items = ($.isFunction(this.options.items) ? this.options.items.call(this.element) : $(this.options.items, this.element)).not('.ui-sortable-helper'); //Only the items of the sortable itself
var ret = [];
items.each(function() { ret.push($(this).attr(attr || 'id')); });
return ret;
+
},
/* Be careful with the following core functions */
intersectsWith: function(item) {