-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Conversation
…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 |
There was a problem hiding this comment.
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()
?
There was a problem hiding this comment.
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.
Ok, I followed your recommendations and I made some modifications. I hope you like them. |
@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! |
Hello @mikesherov , nice to meet you. I am still really interested. |
@patrixd, great! Can you start by rebasing this? Since this PR was opened, all files have been UMD wrapped and renamed. Thanks! |
Closing this due to inactivity. @patrixd if you're interested in continuing please rebase this as @mikesherov requested or open a new PR. Thanks. |
Hello @tjvantoll and @mikesherov I'm so sorry, I have been really busy. |
@patrixd Thanks for this fix. |
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