diff options
author | Scott González <scott.gonzalez@gmail.com> | 2012-01-07 20:48:42 -0500 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2012-01-07 20:48:42 -0500 |
commit | 3cf98e5ca123d0766d96cb76963ad880585e9e91 (patch) | |
tree | dffec7f0960a3eb3474cd777b3971e7677a13e25 /ui/jquery.ui.widget.js | |
parent | 31ebe7e7da7d7ce737a1feb3b19dec047e88a3a5 (diff) | |
download | jquery-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.js | 7 |
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]; |