Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature addition: Include an element's size in the draggable interface #1978

Open
gavinsykes opened this issue Sep 16, 2021 · 0 comments
Open

Comments

@gavinsykes
Copy link

gavinsykes commented Sep 16, 2021

Hi all,

First-time contributor so please forgive any errors or faux pas!

I have been working on a project these last few weeks that required a div that is draggable and resizable, and after trying to build it from scratch by myself for wayyyy longer than I should have done, it was still a mess. I decided at that point, more in hope than expectation, to see if jQuery had a way to make it easier and, well, here we are!

What I have been building is an image uploader that then crops the image to the user's wishes, which has meant having a canvas drawing the part of the picture that is covered by the overlaying <div> whenever it is moved or resized. One thing I noticed however is that whilst resizable's ui object returns the position and size, draggable's only returns the position, so the addition of the element's size is what I am looking to add in here. I have the code ready to go (at least according to my local testing) but thought better than just submitting a PR out of the blue. The branch is at https://github.com/gavinsykes/jquery-ui/tree/add-size-data-to-draggable-ui

Any questions, please ask! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants