Add replaceNode switch
This commit is contained in:
2 files changed
+7
No files matched your search
@@ -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 = []
|
||||
|
||||
Reference in new issue
Block a user