Search and Top Navigation
#5207 closed feature (fixed)
Opened February 21, 2010 01:05PM UTC
Closed February 01, 2011 11:05AM UTC
Last modified June 14, 2012 04:36PM UTC
Abstract event binding
Reported by: | jzaefferer | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | 1.9.0 |
Component: | ui.widget | Version: | 1.8rc2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Something like this should be added in 1.9:
$.widget.prototype._bind = function(elements, handlers) { if (!handlers) { handlers = elements; elements = this.element; } var self = this, $.each(handlers), function(event, handler) { elements.bind(event, function() { if (!self.options.disabled) { return fn.apply(self, arguments); } } }); }
In addition, track all events bound (at least those bind to something else then element) and unbind them in destroy.
Branch for this ticket: http://github.com/jquery/jquery-ui/commits/bind
We shouldn't have merged 1.8.1 into that branch. Can't find the one commit to the branch...