-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Resizable: Modified to allow jquery objects as handles. Fixed #9658: #1377
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
Conversation
…Custom handlers did not work as jquery objects (outside the resizable element)
@@ -199,6 +204,9 @@ $.widget("ui.resizable", $.ui.mouse, { | |||
if (this.handles[i].constructor === String) { | |||
this.handles[i] = this.element.children( this.handles[ i ] ).first().show(); | |||
} | |||
else if (this.handles[i] instanceof $) { |
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.
This should also support DOMElements directly.
Hi @patrixd, and thanks for this. I verified your change works for jQuery objects but this change should also support DOMElements. Also make sure your code adheres to our style guide. If you run |
Thank you @tjvantoll for your assistance, I changed the code and now it supports DOMElements. |
@@ -199,6 +204,10 @@ $.widget("ui.resizable", $.ui.mouse, { | |||
if (this.handles[i].constructor === String) { | |||
this.handles[i] = this.element.children( this.handles[ i ] ).first().show(); | |||
} | |||
else if (this.handles[i] && (this.handles[i].jquery || this.handles[i].nodeType)) { |
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.
The first check here this.handles[i].jquery
is unnecessary. The previous check is already looking at this.handles[i].constructor
.
There are a bunch of style things to clean up, but other that and one small comment I listed above this looks good to me. |
Rebased