implement m.domFor() and use it internally to move and remove nodes. Fix #2780
This commit is contained in:
parent
27fb1ea617
commit
3fd82e6359
8 changed files with 345 additions and 267 deletions
|
|
@ -99,12 +99,15 @@ module.exports = function(options) {
|
|||
}
|
||||
}
|
||||
function removeChild(child) {
|
||||
if (child == null || typeof child !== 'object' || !("nodeType" in child)) {
|
||||
throw new TypeError("Failed to execute removeChild, parameter is not of type 'Node'")
|
||||
}
|
||||
var index = this.childNodes.indexOf(child)
|
||||
if (index > -1) {
|
||||
this.childNodes.splice(index, 1)
|
||||
child.parentNode = null
|
||||
}
|
||||
else throw new TypeError("Failed to execute 'removeChild'")
|
||||
else throw new TypeError("Failed to execute 'removeChild', child not found in parent")
|
||||
}
|
||||
function insertBefore(child, reference) {
|
||||
var ancestor = this
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue