I implemented a simple drag and drop system using directives in Angular. It works fine in Chrome, but Firefox does not expose event.clientX, event.clientY events on a drag event (they just refuse to fix it). Therefore, I am looking for a good alternative to expose these properties when dragging:
x, y coordinates are needed for visual feedback during a drag event.
The code is here:
http://plnkr.co/edit/ApeyQ4FcdsA8Ez18Roi0?p=preview
go to Chrome and Firefox to see the problem.
In Chrome, drag an item into folders, you will have the same item as visual feedback, following the mouse, and not in Firefox (since Firefox does not support e.clientX and e.clientY in the drag event).
problem here: (beginning of line 45)
.on('drag', function(e) { if (e.originalEvent.clientX) { el.css({ 'top': e.originalEvent.clientY + 10, 'left': e.originalEvent.clientX + 10 }); } else { el.css('display', 'none'); } });
So, how can I get the mouse position on the screen during a drag event in Firefox (angular, I mean with directives, no global variable or anything else)?

source share