Im trying to figure this out like desperate but I couldn't come up with the right way.
Im trying to offer users the ability to change the background picture by drag-and-drop a picture into the browser. However, I can't be able to detect the drag events properly. when using
$(window).on 'dragenter', (e) =>
console.log e.target
$(window).on 'dragleave', (e) =>
console.log e.target
I always get the events triggered on individual DOM elements but never on the window/body itself, meaning if my DOM elements/container/wrapper dont cover the whole window, it does not work properly. I know it's possible since GMail can make it work somehow, but I seriously don't know what I'm doing wrong here.
Thanks!