Core (widget): don't pass DOM objects to $.fn.add. Fixes #5743 ($.fn.remove does not trigger remove event for <select>s)

This commit is contained in:
Samuel Cormier-Iijima 2010-07-08 23:36:48 +08:00 committed by Scott González
parent 594b7f5b23
commit 89c0961c38

View File

@ -15,7 +15,7 @@ $.fn.remove = function( selector, keepData ) {
return this.each(function() {
if ( !keepData ) {
if ( !selector || $.filter( selector, [ this ] ).length ) {
$( "*", this ).add( this ).each(function() {
$( "*", this ).add( [ this ] ).each(function() {
$( this ).triggerHandler( "remove" );
});
}