🌐 AI搜索 & 代理 主页
Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Follow-up to gh-1163 with simpler empty string check.
  • Loading branch information
markraddatz committed Feb 8, 2013
commit 4974dd2226b822ca93678c27aa03e8d989c69e40
26 changes: 11 additions & 15 deletions src/manipulation.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,21 +241,17 @@ jQuery.fn.extend({
value = jQuery( value ).not( this ).detach();
}

if ( value === "" ) {
return this.each(function() {
jQuery( this ).remove();
});
}

return this.domManip( [ value ], true, function( elem ) {
var next = this.nextSibling,
parent = this.parentNode;

if ( parent ) {
jQuery( this ).remove();
parent.insertBefore( elem, next );
}
});
return value === "" ?
this.remove() :
this.domManip( [ value ], true, function( elem ) {
var next = this.nextSibling,
parent = this.parentNode;

if ( parent ) {
jQuery( this ).remove();
parent.insertBefore( elem, next );
}
});
},

detach: function( selector ) {
Expand Down