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");
})
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;
}
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 || {};
},
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) {