Permalink
Browse files

Widget: Wrap the remove event trigerring in a try/catch. Fixes #7510 …

…- jQuery.data throws a script error in certain circumstances.
  • Loading branch information...
1 parent 1b5af10 commit c7c5b6b15cd24ae0de95ff576f8ca6b6b8892ced @scottgonzalez committed Aug 9, 2011
Showing with 8 additions and 2 deletions.
  1. +8 −2 ui/jquery.ui.widget.js
View
@@ -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 ) {}
});
}
}

0 comments on commit c7c5b6b

Please sign in to comment.