Skip to content
Permalink
Browse files

Widget: Set guid on event handler proxies so direct unbinding works.

  • Loading branch information...
scottgonzalez committed Jan 8, 2012
1 parent 31ebe7e commit 3cf98e5ca123d0766d96cb76963ad880585e9e91
Showing with 7 additions and 0 deletions.
  1. +7 −0 ui/jquery.ui.widget.js
@@ -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];

0 comments on commit 3cf98e5

Please sign in to comment.
You can’t perform that action at this time.