desandro / draggabilly

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

Support for containment being 'window' #83

Closed brousalis closed 6 years ago

brousalis commented 9 years ago

I have a use case where i'd like the containment to be the 'window', instead of an element.

http://codepen.io/anon/pen/gpbmdm

Throws an undefined here L325 (container will be null since document.querySelector('window')

The solution is a little hacky, and I understand if you don't want containment to support window. Just thought I'd submit a PR from my fork.

desandro commented 9 years ago

Thanks for this contribution! I think this is a bit of an edge case, but it's a nice feature. I'll keep the PR open for a bit so others can take a look.

desandro commented 6 years ago

I've decided to pass on this request. Thanks again for your contribution!