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

Resizable: Modified to allow jquery objects as handles. Fixed #9658: Custom handlers did not work as jquery objects (outside the resizable element) #1135

Closed
wants to merge 2 commits into from

Conversation

patrixd
Copy link
Contributor

@patrixd patrixd commented Nov 14, 2013

I needed to use as handle a div outside the resizable element. So I tried to specify the jquery element as the documentation said but it did not work.
handles: { "s": $("#customResizableHandle") },

The documentation said in handles option:
Object:
The following keys are supported: { n, e, s, w, ne, se, sw, nw }. The value of any specified should be a jQuery selector matching the child element of the resizable to use as that handle. If the handle is not a child of the resizable, you can pass in the DOMElement or a valid jQuery object directly.

Note: When generating your own handles, each handle must have the ui-resizable-handle class, as well as the appropriate ui-resizable-{direction} class, .e.g., ui-resizable-s.

This pull fix that bug. Now I can use a handle outside the element resizable. I hope this help.

I started using a code of a Stackoverflow reply from ylebre http://stackoverflow.com/questions/958419/custom-resizable-handles-in-jquery-ui but it didn't work at the beginning so I had to change it.

Ticket: http://bugs.jqueryui.com/ticket/9658

…Custom handlers did not work as jquery objects (outside the resizable element)

this._handles = $(".ui-resizable-handle", this.element);

//Add the custom handles of jquery Objects outside this.element
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this logic be inside _renderAxis()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wherever you think is better. The important is that this._handles must contain the custom handles (outside this.element). I'm not sure if you need to add some edition to them in renderAxis. In my case there is not need. I didn't write this._handles = $(".ui-resizable-handle").disableSelection(); to include the outside elements because I think that it wouldn't be a good practice. I have more than one element resizable in a page. Evenmore I have a resizable inside another one. So I decided to include in this._handles all this.handles (the handles indicated in the current resizable options) and it works perfectly.

@patrixd
Copy link
Contributor Author

patrixd commented Nov 15, 2013

Ok, I followed your recommendations and I made some modifications. I hope you like them.

@mikesherov
Copy link
Member

@patrixd thanks for contributing! Are you still interested in pursuing this? If so, let me know and I'll review it, but for now, I'm going to closing this until your reply!

@mikesherov mikesherov closed this Aug 11, 2014
@patrixd
Copy link
Contributor Author

patrixd commented Aug 11, 2014

Hello @mikesherov , nice to meet you.

I am still really interested.

@mikesherov
Copy link
Member

@patrixd, great! Can you start by rebasing this? Since this PR was opened, all files have been UMD wrapped and renamed. Thanks!

@mikesherov mikesherov reopened this Aug 11, 2014
@tjvantoll
Copy link
Member

Closing this due to inactivity. @patrixd if you're interested in continuing please rebase this as @mikesherov requested or open a new PR. Thanks.

@tjvantoll tjvantoll closed this Oct 23, 2014
@patrixd
Copy link
Contributor Author

patrixd commented Oct 24, 2014

Hello @tjvantoll and @mikesherov I'm so sorry, I have been really busy.
Currently I have more time and I rebased my branch.
#1377
I requested the pull, I hope the changes are ok and you can merge them. Thanks so much.

@estshy
Copy link

estshy commented Oct 30, 2014

@patrixd Thanks for this fix.

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

Successfully merging this pull request may close these issues.

5 participants