File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -301,9 +301,10 @@ $.Widget.prototype = {
301
301
element = $ ( element ) ;
302
302
this . bindings = this . bindings . add ( element ) ;
303
303
}
304
+
304
305
var instance = this ;
305
306
$ . each ( handlers , function ( event , handler ) {
306
- element . bind ( event + "." + instance . widgetName , function ( ) {
307
+ function handlerProxy ( ) {
307
308
// allow widgets to customize the disabled handling
308
309
// - disabled as an array instead of boolean
309
310
// - disabled class as method for disabling individual parts
@@ -313,7 +314,15 @@ $.Widget.prototype = {
313
314
}
314
315
return ( typeof handler === "string" ? instance [ handler ] : handler )
315
316
. apply ( instance , arguments ) ;
316
- } ) ;
317
+ }
318
+ var match = key . match ( / ^ ( \w + ) \s * ( .* ) $ / ) ;
319
+ var eventName = match [ 1 ] + "." + instance . widgetName ,
320
+ selector = match [ 2 ] ;
321
+ if ( selector === '' ) {
322
+ element . bind ( eventName , handlerProxy ) ;
323
+ } else {
324
+ element . delegate ( selector , eventName , handlerProxy ) ;
325
+ }
317
326
} ) ;
318
327
} ,
319
328
You can’t perform that action at this time.
0 commit comments