desandro / draggabilly

:point_down: Make that shiz draggable
https://draggabilly.desandro.com
MIT License
3.86k stars 386 forks source link

jQuery-less dist files / .trigger check #133

Closed silverwind closed 8 years ago

silverwind commented 8 years ago

I'm using a custom build of jQuery that does not include .trigger,which results in an error when Draggabilly tries to call it. I've solved the issue now by loading Draggabilly before jQuery so I get the vanilla version of Draggabilly. As for a better solution, I'd suggest either:

1) Provide dist files for a pure vanilla version, with the jQuery parts removed. I'd love to see the optional dependency removed, which would reduce the size of this script significantly.

2) Add a check for this.$element.trigger on this line.

desandro commented 8 years ago

Thanks for reporting this issue.

I'm using a custom build of jQuery that does not include .trigger

This sounds like an edge case. If you're using jQuery, I expect .trigger to be there. Another solution is to fork Draggabilly and remove the jQuery parts. I'll leave that up to you. I appreciate your input here, but I feel this scenario is not significant enough to modify Draggabilly.

silverwind commented 8 years ago

fork Draggabilly and remove the jQuery parts

That's just what I did. You should consider dropping support too 😉.