aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2011-08-09 11:51:08 -0400
committerScott González <scott.gonzalez@gmail.com>2011-08-09 11:51:08 -0400
commitc7c5b6b15cd24ae0de95ff576f8ca6b6b8892ced (patch)
tree95874e3c429408d6852367a4ea662f96d3741541
parent1b5af10bb1f4602885ea7be41262d3cd7e72adc4 (diff)
downloadjquery-ui-c7c5b6b15cd24ae0de95ff576f8ca6b6b8892ced.tar.gz
jquery-ui-c7c5b6b15cd24ae0de95ff576f8ca6b6b8892ced.zip
Widget: Wrap the remove event trigerring in a try/catch. Fixes #7510 - jQuery.data throws a script error in certain circumstances.
-rw-r--r--ui/jquery.ui.widget.js10
1 files changed, 8 insertions, 2 deletions
diff --git a/ui/jquery.ui.widget.js b/ui/jquery.ui.widget.js
index a0df33e1c..4aa42e0b7 100644
--- a/ui/jquery.ui.widget.js
+++ b/ui/jquery.ui.widget.js
@@ -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 ) {}
});
}
}