aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.widget.js
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-01-07 20:48:42 -0500
committerScott González <scott.gonzalez@gmail.com>2012-01-07 20:48:42 -0500
commit3cf98e5ca123d0766d96cb76963ad880585e9e91 (patch)
treedffec7f0960a3eb3474cd777b3971e7677a13e25 /ui/jquery.ui.widget.js
parent31ebe7e7da7d7ce737a1feb3b19dec047e88a3a5 (diff)
downloadjquery-ui-3cf98e5ca123d0766d96cb76963ad880585e9e91.tar.gz
jquery-ui-3cf98e5ca123d0766d96cb76963ad880585e9e91.zip
Widget: Set guid on event handler proxies so direct unbinding works.
Diffstat (limited to 'ui/jquery.ui.widget.js')
-rw-r--r--ui/jquery.ui.widget.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js
index 4f47a008b..5c8560bfd 100644
--- a/ui/jquery.ui.widget.js
+++ b/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];