mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-27 08:02:51 +02:00
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:
@@ -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);
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user