@@ -211,11 +211,12 @@ $.Widget.prototype = {
211
211
_createWidget : function ( options , element ) {
212
212
element = $ ( element || this . defaultElement || this ) [ 0 ] ;
213
213
this . element = $ ( element ) ;
214
+ this . uuid = uuid ++ ;
215
+ this . eventNamespace = "." + this . widgetName + this . uuid ;
214
216
this . options = $ . widget . extend ( { } ,
215
217
this . options ,
216
218
this . _getCreateOptions ( ) ,
217
219
options ) ;
218
- this . uuid = uuid ++ ;
219
220
220
221
this . bindings = $ ( ) ;
221
222
this . hoverable = $ ( ) ;
@@ -249,7 +250,7 @@ $.Widget.prototype = {
249
250
// we can probably remove the unbind calls in 2.0
250
251
// all event bindings should go through this._on()
251
252
this . element
252
- . unbind ( "." + this . widgetName + this . uuid )
253
+ . unbind ( this . eventNamespace )
253
254
// 1.9 BC for #7810
254
255
// TODO remove dual storage
255
256
. removeData ( this . widgetName )
@@ -258,14 +259,14 @@ $.Widget.prototype = {
258
259
// http://bugs.jquery.com/ticket/9413
259
260
. removeData ( $ . camelCase ( this . widgetFullName ) ) ;
260
261
this . widget ( )
261
- . unbind ( "." + this . widgetName + this . uuid )
262
+ . unbind ( this . eventNamespace )
262
263
. removeAttr ( "aria-disabled" )
263
264
. removeClass (
264
265
this . widgetFullName + "-disabled " +
265
266
"ui-state-disabled" ) ;
266
267
267
268
// clean up events and states
268
- this . bindings . unbind ( "." + this . widgetName + this . uuid ) ;
269
+ this . bindings . unbind ( this . eventNamespace ) ;
269
270
this . hoverable . removeClass ( "ui-state-hover" ) ;
270
271
this . focusable . removeClass ( "ui-state-focus" ) ;
271
272
} ,
@@ -376,7 +377,7 @@ $.Widget.prototype = {
376
377
}
377
378
378
379
var match = event . match ( / ^ ( \w + ) \s * ( .* ) $ / ) ,
379
- eventName = match [ 1 ] + "." + instance . widgetName + instance . uuid ,
380
+ eventName = match [ 1 ] + instance . eventNamespace ,
380
381
selector = match [ 2 ] ;
381
382
if ( selector ) {
382
383
instance . widget ( ) . delegate ( selector , eventName , handlerProxy ) ;
0 commit comments