Ticket #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: | ||
| Blocking: | Blocked by: |
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
Change History
Note: See
TracTickets for help on using
tickets.



Patch that fixes ticket