Skip to main content

Search and Top Navigation

#9498 closed feature (invalid)

Opened August 15, 2013 02:27PM UTC

Closed August 30, 2013 08:46AM UTC

Last modified August 30, 2013 05:13PM UTC

Resizable: multiple handles for same direction not supported

Reported by: barhorn Owned by: barhorn
Priority: minor Milestone: none
Component: ui.resizable Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:
Description

If multiple handles are defined for the same direction (ex: "w", "ne", etc), then only the first one is ever taken into consideration.

Here's the fiddle: http://jsfiddle.net/2zFMU/4/

The fix is actually quite simple:

in jquery.ui.resizable.js around line 253 (jQueryUI v1.10.3), we should loop over the handles object instead of just grabbing the first one. ie, change:

::removed::

Attachments (0)
Change History (7)

Changed August 15, 2013 03:04PM UTC by scottgonzalez comment:1

description: If multiple handles are defined for the same direction (ex: "w", "ne", etc), then only the first one is ever taken into consideration. \ \ Here's the fiddle: http://jsfiddle.net/2zFMU/4/ \ \ The fix is actually quite simple: \ \ in jquery.ui.resizable.js around line 253 (jQueryUI v1.10.3), we should loop over the handles object instead of just grabbing the first one. ie, change: \ \ {{{ \ _mouseCapture: function(event) { \ var i, handle, \ capture = false; \ \ for (i in this.handles) { \ handle = $(this.handles[i])[0]; \ if (handle === event.target || $.contains(handle, event.target)) { \ capture = true; \ } \ } \ \ return !this.options.disabled && capture; \ }, \ }}} \ \ to \ \ \ {{{ \ _mouseCapture: function(event) { \ var i, handle, \ capture = false; \ \ for (i in this.handles) { \ $(this.handles[i]).each(function(idxHandle,handle) { \ if (handle === event.target || $.contains(handle, event.target)) { \ capture = true; \ return false; //get out of the $().each loop \ } \ }); \ } \ \ return !this.options.disabled && capture; \ }, \ }}} \ If multiple handles are defined for the same direction (ex: "w", "ne", etc), then only the first one is ever taken into consideration. \ \ Here's the fiddle: http://jsfiddle.net/2zFMU/4/ \ \ The fix is actually quite simple: \ \ in jquery.ui.resizable.js around line 253 (jQueryUI v1.10.3), we should loop over the handles object instead of just grabbing the first one. ie, change: \ \ ::removed::
owner: → barhorn
status: newpending
type: bugfeature

This is not a bug, but a feature request. Can you please explain the real use case for this?

Changed August 15, 2013 03:15PM UTC by barhorn comment:2

status: pendingnew

Replying to [comment:1 scott.gonzalez]:

This is not a bug, but a feature request. Can you please explain the real use case for this?

Sure. It's similar to the jsFiddle. Basically, we have a specific element that is overloaded with a number of functionalities: drag the handle left/right to resize the Resizable, click it to open/close the resizable, etc. However, users also want to be able to drag the edge of the Resizable element in order to resize it, but they don't want to get rid of the functionality of the tab/handle that is there either. Therefore we need multiple handles to resize the element.

Changed August 15, 2013 03:20PM UTC by scottgonzalez comment:3

status: newpending

Why can't you just nest? http://jsfiddle.net/2zFMU/5/

Changed August 30, 2013 08:46AM UTC by trac-o-bot comment:4

resolution: → invalid
status: pendingclosed

Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!

Changed August 30, 2013 03:06PM UTC by barhorn comment:5

Comment to keep this ticket open. Would still like to see this minor feature added....

Changed August 30, 2013 03:56PM UTC by scottgonzalez comment:6

You haven't answered the question.

Changed August 30, 2013 05:13PM UTC by barhorn comment:7

Replying to [comment:6 scott.gonzalez]:

You haven't answered the question.

Sorry, I missed your suggestion. In my particular case, you are probably correct: I could just nest to get the desired effect. I just don't see the reason in the resizable code to limit the handle to be a single element (by grabbing the first one) rather than multiple.

If I'm the only person that has ever brought this up, go ahead and close this ticket. Your suggestion will work for my current use case. Thanks!