My logic is
if( !this.draginited() ) // a drag-disabled element shouldn't get pass here, as it is inited
this.draggable({...})
I searched a lot and couldn't find a way to implement this logic, any ideas?
My logic is
if( !this.draginited() ) // a drag-disabled element shouldn't get pass here, as it is inited
this.draggable({...})
I searched a lot and couldn't find a way to implement this logic, any ideas?
Maybe there's an easier way, but the docs say:
Draggable elements gets a class of ui-draggable
so you could do something like:
if(!$("#foo").hasClass("ui-draggable")) {
...
}
so to wrap that up (untested):
$.fn.isDraggable = function() {
return $(this).hasClass("ui-draggable");
}
console.log($("#someElement").isDraggable());