#5621 closed bug (duplicate)
function _setOption uses self instead of this
Reported by: | karachi | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.8.2 |
Component: | ui.sortable | Version: | 1.8.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Steps to reproduce:
- Create sortable objects: $('#sort').sortable();
- Set option via method 'option': $('#sort').sortable('option', 'axis', 'x')
- Error occures: this.options is undefined
This occures because function $.Widget.prototype._setOption() is called in context of self which points to window. This should be used instead.
Here is the patch
--- jquery.ui.sortable.js 2010-04-30 11:50:24.000000000 +0300 +++ jquery.ui.sortable.fixed.js 2010-05-17 19:38:26.000000000 +0300 @@ -81,7 +81,7 @@ [ value ? "addClass" : "removeClass"]( "ui-sortable-disabled" ); } else { // Don't call widget base _setOption for disable as it adds ui-state-disabled class - $.Widget.prototype._setOption.apply(self, arguments); + $.Widget.prototype._setOption.apply(this, arguments); } },
Attachments (1)
Change History (3)
Changed 13 years ago by
Attachment: | setOption.patch added |
---|
comment:1 Changed 13 years ago by
Milestone: | TBD → 1.9 |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Duplicate of #5581
comment:2 Changed 13 years ago by
Milestone: | 1.9 → 1.8.2 |
---|
Note: See
TracTickets for help on using
tickets.
Patch that fixes ticket