mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Widget: Don't swallow errors in remove
events
The try/catch was only there to support jQuery <1.6.3, which we no longer support. Ref jquery/jquery#3554
This commit is contained in:
parent
278d1e1108
commit
1f2011ece3
14
ui/widget.js
14
ui/widget.js
@ -32,16 +32,12 @@ $.cleanData = ( function( orig ) {
|
|||||||
return function( elems ) {
|
return function( elems ) {
|
||||||
var events, elem, i;
|
var events, elem, i;
|
||||||
for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {
|
for ( i = 0; ( elem = elems[ i ] ) != null; i++ ) {
|
||||||
try {
|
|
||||||
|
|
||||||
// Only trigger remove when necessary to save time
|
// Only trigger remove when necessary to save time
|
||||||
events = $._data( elem, "events" );
|
events = $._data( elem, "events" );
|
||||||
if ( events && events.remove ) {
|
if ( events && events.remove ) {
|
||||||
$( elem ).triggerHandler( "remove" );
|
$( elem ).triggerHandler( "remove" );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Http://bugs.jquery.com/ticket/8235
|
|
||||||
} catch ( e ) {}
|
|
||||||
}
|
}
|
||||||
orig( elems );
|
orig( elems );
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user