Skip to content

Commit 3cf98e5

Browse files
committed
Widget: Set guid on event handler proxies so direct unbinding works.
1 parent 31ebe7e commit 3cf98e5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ui/jquery.ui.widget.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,13 @@ $.Widget.prototype = {
329329
return ( typeof handler === "string" ? instance[ handler ] : handler )
330330
.apply( instance, arguments );
331331
}
332+
333+
// copy the guid so direct unbinding works
334+
if ( typeof handler !== "string" ) {
335+
handlerProxy.guid = handler.guid =
336+
handler.guid || handlerProxy.guid || jQuery.guid++;
337+
}
338+
332339
var match = event.match( /^(\w+)\s*(.*)$/ ),
333340
eventName = match[1] + "." + instance.widgetName,
334341
selector = match[2];

0 commit comments

Comments
 (0)