mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Widget: Set guid on event handler proxies so direct unbinding works.
This commit is contained in:
parent
31ebe7e7da
commit
3cf98e5ca1
7
ui/jquery.ui.widget.js
vendored
7
ui/jquery.ui.widget.js
vendored
@ -329,6 +329,13 @@ $.Widget.prototype = {
|
||||
return ( typeof handler === "string" ? instance[ handler ] : handler )
|
||||
.apply( instance, arguments );
|
||||
}
|
||||
|
||||
// copy the guid so direct unbinding works
|
||||
if ( typeof handler !== "string" ) {
|
||||
handlerProxy.guid = handler.guid =
|
||||
handler.guid || handlerProxy.guid || jQuery.guid++;
|
||||
}
|
||||
|
||||
var match = event.match( /^(\w+)\s*(.*)$/ ),
|
||||
eventName = match[1] + "." + instance.widgetName,
|
||||
selector = match[2];
|
||||
|
Loading…
Reference in New Issue
Block a user