Search and Top Navigation
#4186 closed bug (fixed)
Opened February 19, 2009 12:06PM UTC
Closed September 28, 2016 03:56PM UTC
Last modified September 28, 2016 10:01PM UTC
Resizable: aspectRatio cannot be changed after initialization
Reported by: | tcarnell | Owned by: | scottgonzalez |
---|---|---|---|
Priority: | major | Milestone: | 1.12.2 |
Component: | ui.resizable | Version: | 1.6rc6 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I have a resizable div, and want to change the 'aspectRatio' behaviour on the fly. Attempting the following code has no affect:
$("#myResizable).resizable('option', 'aspectRatio', newState);
(where 'newState' is either true|false)
The workaround is as follows, but I am concerned about the cost overhead:
$("#myResizable).resizable('destroy'); //re-initialize the resizable with the desired 'aspectRatio' value
Attachments (0)
Change History (14)
Changed February 19, 2009 12:07PM UTC by comment:1
Changed February 20, 2009 01:00PM UTC by comment:2
milestone: | TBD → 1.6 |
---|---|
priority: | major → critical |
Changed February 20, 2009 01:48PM UTC by comment:3
milestone: | 1.7 → 1.next |
---|---|
priority: | critical → blocker |
Changed May 13, 2009 12:11AM UTC by comment:4
I just ran into this issue myself. Here's a quick workaround if someone needs it (probably not the right way to really patch it, though):
(function() { // Work around http://dev.jqueryui.com/ticket/4186 var oldSetData = $.ui.resizable.prototype._setData; $.ui.resizable.prototype._setData = function(key, value) { oldSetData.apply(this, arguments); if (key === "aspectRatio") { this._aspectRatio = !!value; } }; })();
Changed May 14, 2010 11:09AM UTC by comment:5
Yep, it still exists in 1.8.1 :/
Changed October 19, 2010 03:19PM UTC by comment:6
milestone: | 1.next → 1.9 |
---|
Changed October 19, 2010 04:09PM UTC by comment:7
priority: | blocker → major |
---|
Changed June 25, 2011 12:26AM UTC by comment:9
An updated workaround for recent versions of jQuery UI:
(function() { var oldSetOption = $.ui.resizable.prototype._setOption; $.ui.resizable.prototype._setOption = function(key, value) { oldSetOption.apply(this, arguments); if (key === "aspectRatio") { this._aspectRatio = !!value; } }; })();
Changed October 11, 2012 02:49PM UTC by comment:10
milestone: | 1.9.0 → 2.0.0 |
---|
Changed October 28, 2012 01:57AM UTC by comment:11
status: | new → open |
---|---|
summary: | changing aspectRatio of resizable using 'option' feature after init does not work → Resizable: aspectRatio cannot be changed after initialization |
Verified that this is still an issue in 1.9.1 - http://jsfiddle.net/tj_vantoll/L4h3F/.
Changed November 01, 2012 01:08AM UTC by comment:12
#5208 is a duplicate of this ticket.
Changed September 28, 2016 03:56PM UTC by comment:13
_comment0: | Fixed in [https://github.com/jquery/jquery-ui/commit/c481400f222c871ba5853bc2930a3b8b4375d08b c481400f222c871ba5853bc2930a3b8b4375d08b]. → 1475100083254522 |
---|---|
keywords: | aspectRatio resizable option init |
milestone: | 2.0.0 → 1.12.2 |
resolution: | → fixed |
status: | open → closed |
Changed September 28, 2016 10:01PM UTC by comment:14
owner: | → scottgonzalez |
---|
In [changeset:"c481400f222c871ba5853bc2930a3b8b4375d08b" c481400f]:
#!CommitTicketReference repository="" revision="c481400f222c871ba5853bc2930a3b8b4375d08b" Resizable: Fix aspectRatio cannot be changed after initialization. Fixes #4186 Closes gh-1750
(sorry) missed a closing double quote on the code samples above, should have been: