Add replaceNode switch

This commit is contained in:
Behind The Math committed 2018-03-17 21:26:07 -04:00
1 parent 5e41a32cf4
commit d22262e5a7
2 files changed
+7

No files matched your search

+6
View File
@@ -26,6 +26,12 @@ module.exports = {
this.onSwitch()
},
// Equivalent to outerHTML(), but doesn't require switchElementsAlt() for <head> and <body>
replaceNode: function(oldEl, newEl) {
oldEl.parentNode.replaceChild(newEl, oldEl)
this.onSwitch()
},
sideBySide: function(oldEl, newEl, options, switchOptions) {
var forEach = Array.prototype.forEach
var elsToRemove = []