Skip to content
This repository has been archived by the owner on Aug 22, 2022. It is now read-only.

Issue with jQuery 1.8/1.9 #11

Open
jasonshaev opened this issue Mar 1, 2016 · 1 comment
Open

Issue with jQuery 1.8/1.9 #11

jasonshaev opened this issue Mar 1, 2016 · 1 comment

Comments

@jasonshaev
Copy link

I'm hitting an issue using lrDragNDrop (along with angular smart table) when jQuery 1.8.2 is included on the page. The issue appears to be that, in these older versions of jQuery, event.offsetX and event.offsetY are not copied from the "original" event to the jQuery event, so these lines:
https://github.com/lorenzofox3/lrDragNDrop/blob/master/lrDragNDrop.js#L144
https://github.com/lorenzofox3/lrDragNDrop/blob/master/lrDragNDrop.js#L170

do not work as intended.

Here is a plunk illustrating the issue:
https://plnkr.co/edit/Pm7AN1is7gc7gZ4aCZHs?p=preview

Since offsetX and offsetY are both undef, isAfter() always returns false. This prevents the user from dragging a column to be the "last" (rightmost) column.
NOTE: jQuery must be included before angular. I tested this with jQuery 1.8.2 and 1.9. It doesn't appear to still be an issue with jQuery 2.0+.
NOTE: removing jQuery fixes the issue, as does changing the order of includes.

I will be submitting a pull request shortly which alleviates this issue by checking for jQuery, and if it's available reading offsetX and offsetY from event.originalEvent.

@jasonshaev
Copy link
Author

Pull Request: #12

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant