Allow using a Function as the cancel option instead of a Selector.
This is particularly useful when using Sortable on nested lists. I had a similar issue to that listed in issue #1996. Allowing cancel option to be a function allows me to override the default cancel implementation using a selector with something like:
$('.container', context).sortable({ items: '>.widget', cancel: function (event) { return $(event.target).closest('.widget').is('.locked'); } });
The committers listed above are authorized under a signed CLA.
- :white_check_mark: login: kghandi (af50299fb12de9527f84e07b884f49436bec9fad)
Sounds reasonable to me and the changes are not that big, so I'm fine with integrating this when all requirements are met.
I have fixed the code style as requested. I have also created pull request for api documentation https://github.com/jquery/api.jqueryui.com/pull/369