aboutsummaryrefslogtreecommitdiffstats
path: root/src/manipulation.js
diff options
context:
space:
mode:
authorRichard Gibson <richard.gibson@gmail.com>2013-01-16 12:55:56 -0500
committerRichard Gibson <richard.gibson@gmail.com>2013-01-16 13:57:00 -0500
commita96aa9e2709b4ba132b966a0f1a13d0e8eb49b9a (patch)
tree2399350a8b799e1941c531cf9a15e40d894e3789 /src/manipulation.js
parent306b698813c7d999b6f572d8d00b2691952fdea6 (diff)
downloadjquery-a96aa9e2709b4ba132b966a0f1a13d0e8eb49b9a.tar.gz
jquery-a96aa9e2709b4ba132b966a0f1a13d0e8eb49b9a.zip
Fix #13233: re-allow .replaceWith of text nodes. Close gh-1137.
(cherry picked from commit 6b1b0a26b4d485b4d9f334286efed5dfe33e3f3f)
Diffstat (limited to 'src/manipulation.js')
-rw-r--r--src/manipulation.js10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/manipulation.js b/src/manipulation.js
index 75c6be7b4..3193ad7af 100644
--- a/src/manipulation.js
+++ b/src/manipulation.js
@@ -243,15 +243,9 @@ jQuery.fn.extend({
var next = this.nextSibling,
parent = this.parentNode;
- if ( parent && this.nodeType === 1 || this.nodeType === 11 ) {
-
+ if ( parent ) {
jQuery( this ).remove();
-
- if ( next ) {
- next.parentNode.insertBefore( elem, next );
- } else {
- parent.appendChild( elem );
- }
+ parent.insertBefore( elem, next );
}
});
},