Skip to main content

Search and Top Navigation

#5208 closed bug (duplicate)

Opened February 21, 2010 09:41PM UTC

Closed November 01, 2012 01:08AM UTC

cannot set the aspectRatio to or from false after init

Reported by: daninmanchester Owned by:
Priority: minor Milestone: 2.0.0
Component: ui.resizable Version: 1.7.2
Keywords: init, aspectRatio Cc:
Blocked by: Blocking:
Description

If the aspectRatio is false at init it cannot be set after init.

If the aspectRation is set to a value at init it cannot be set to false after init.

If I use this :

''$("#Selected").resizable({containment: 'parent', aspectRatio:1});''

this does not work :

''$('#Selected').resizable('option', 'aspectRatio', false)''

and vice versa

Attachments (0)
Change History (5)

Changed March 10, 2010 04:13PM UTC by scottgonzalez comment:1

milestone: TBD1.next

Changed April 14, 2010 08:13PM UTC by aflin comment:2

I used the following code to fix this in 1.8rc3:

$(function() {

$.extend($.ui.resizable.prototype, (function (orig) {

return {

_mouseStart: function (event) {

this._aspectRatio = !!(this.options.aspectRatio);

return(orig.call(this, event));

}

};

})($.ui.resizable.prototype["_mouseStart"]));

});

I mostly copied the method of the fix from somewhere else, so not sure if its the proper way.

Changed April 14, 2010 08:25PM UTC by aflin comment:3

One more time. Wiki messed up the brackets around _mouseStart

$(function() {

$.extend($.ui.resizable.prototype, (function (orig) {

return {

_mouseStart: function (event) {

this._aspectRatio = !!(this.options.aspectRatio);

return(orig.call(this, event));

}

};

})($.ui.resizable.prototype!["_mouseStart"]));

});

Changed October 03, 2012 05:01PM UTC by scottgonzalez comment:4

milestone: 1.next2.0.0

Changed November 01, 2012 01:08AM UTC by tj.vantoll comment:5

resolution: → duplicate
status: newclosed

Duplicate of #4186.