diff options
Diffstat (limited to 'ui/jquery.ui.widget.js')
-rw-r--r-- | ui/jquery.ui.widget.js | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js index a66b8a54a..31328a455 100644 --- a/ui/jquery.ui.widget.js +++ b/ui/jquery.ui.widget.js @@ -14,7 +14,10 @@ var slice = Array.prototype.slice; var _cleanData = $.cleanData; $.cleanData = function( elems ) { for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) { - $( elem ).triggerHandler( "remove" ); + try { + $( elem ).triggerHandler( "remove" ); + // http://bugs.jquery.com/ticket/8235 + } catch( e ) {} } _cleanData( elems ); }; @@ -267,9 +270,9 @@ $.Widget.prototype = { return this; }, _setOptions: function( options ) { - var self = this; + var that = this; $.each( options, function( key, value ) { - self._setOption( key, value ); + that._setOption( key, value ); }); return this; @@ -323,13 +326,22 @@ $.Widget.prototype = { eventName = match[1] + "." + instance.widgetName, selector = match[2]; if ( selector ) { - element.delegate( selector, eventName, handlerProxy ); + instance.widget().delegate( selector, eventName, handlerProxy ); } else { element.bind( eventName, handlerProxy ); } }); }, + _delay: function( handler, delay ) { + function handlerProxy() { + return ( typeof handler === "string" ? instance[ handler ] : handler ) + .apply( instance, arguments ); + } + var instance = this; + return setTimeout( handlerProxy, delay || 0 ); + }, + _hoverable: function( element ) { this.hoverable = this.hoverable.add( element ); this._bind( element, { |