chore(draggable): jQuery adapter returns Draggable instance

Draggable instance instead of a jQuery collection.
Why? Becomes a mess if Draggable is instantiated multiple times from
the same HTML element.

BREAKING CHANGES: If you was accessing to Draggable instances through
.data('drag') you should remove the `data` getter. Since now the instance
is returned directly.
This commit is contained in:
vieron
2013-10-26 19:52:10 +02:00
parent 4d9b2a84f1
commit d0ca62826a
2 changed files with 2 additions and 6 deletions
+1 -5
View File
@@ -358,11 +358,7 @@
//jQuery adapter
$.fn.drag = function ( options ) {
return this.each(function () {
if (!$.data(this, 'drag')) {
$.data(this, 'drag', new Draggable( this, options ));
}
});
return new Draggable(this, options);
};
+1 -1
View File
@@ -682,7 +682,7 @@
}, 60)
});
this.drag_api = this.$el.drag(draggable_options).data('drag');
this.drag_api = this.$el.drag(draggable_options);
return this;
};