]> source.dussan.org Git - jquery-ui.git/commitdiff
Widget: Wrap the remove event trigerring in a try/catch. Fixes #7510 - jQuery.data...
authorScott González <scott.gonzalez@gmail.com>
Tue, 9 Aug 2011 15:51:08 +0000 (11:51 -0400)
committerScott González <scott.gonzalez@gmail.com>
Tue, 9 Aug 2011 15:51:08 +0000 (11:51 -0400)
ui/jquery.ui.widget.js

index a0df33e1cba6509b1bd5f9204030ee5942e414d7..4aa42e0b7ed39e1e35349c32bd38fe129796824a 100644 (file)
@@ -14,7 +14,10 @@ if ( $.cleanData ) {
        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 );
        };
@@ -25,7 +28,10 @@ if ( $.cleanData ) {
                        if ( !keepData ) {
                                if ( !selector || $.filter( selector, [ this ] ).length ) {
                                        $( "*", this ).add( [ this ] ).each(function() {
-                                               $( this ).triggerHandler( "remove" );
+                                               try {
+                                                       $( this ).triggerHandler( "remove" );
+                                               // http://bugs.jquery.com/ticket/8235
+                                               } catch( e ) {}
                                        });
                                }
                        }