Opened 10 years ago

Closed 7 years ago

#5208 closed bug (duplicate)

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

Change History (5)

comment:1 Changed 10 years ago by Scott González

Milestone: TBD1.next

comment:2 Changed 10 years ago by aflin

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.

comment:3 Changed 10 years ago by aflin

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"]));

});

comment:4 Changed 7 years ago by Scott González

Milestone: 1.next2.0.0

comment:5 Changed 7 years ago by tj.vantoll

Resolution: duplicate
Status: newclosed

Duplicate of #4186.

Note: See TracTickets for help on using tickets.