|
|
@ -521,23 +521,26 @@ export default function dom(
|
|
|
|
this._content.forEach(node =>{ //append all named slots
|
|
|
|
this._content.forEach(node =>{ //append all named slots
|
|
|
|
if(named[node.slot] && slot.getAttribute("name") == node.slot){
|
|
|
|
if(named[node.slot] && slot.getAttribute("name") == node.slot){
|
|
|
|
if(!slot.hasAttribute("hasupdated")){
|
|
|
|
if(!slot.hasAttribute("hasupdated")){
|
|
|
|
|
|
|
|
while (slot.firstChild) {
|
|
|
|
|
|
|
|
slot.removeChild(slot.firstChild)
|
|
|
|
|
|
|
|
}
|
|
|
|
slot.appendChild(named[node.slot]);
|
|
|
|
slot.appendChild(named[node.slot]);
|
|
|
|
slot.setAttribute("hasupdated","")
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
slot.setAttribute("hasupdated","")
|
|
|
|
slotted.push(node)
|
|
|
|
slotted.push(node)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
if(!defaultslot) return(this.slotting=false);
|
|
|
|
if(!defaultslot) return(this.slotting=false);
|
|
|
|
// put what evers left info default slot
|
|
|
|
// put what evers left info default slot
|
|
|
|
this._content
|
|
|
|
let toAppend = this._content.filter(node => slotted.indexOf(node)==-1)
|
|
|
|
.filter(node => slotted.indexOf(node)==-1)
|
|
|
|
// remove default
|
|
|
|
.forEach(node => {
|
|
|
|
if(!defaultslot.hasAttribute("hasupdated") && toAppend.length){
|
|
|
|
if(!defaultslot.hasAttribute("hasupdated")){
|
|
|
|
while (defaultslot.firstChild) {
|
|
|
|
|
|
|
|
defaultslot.removeChild(defaultslot.firstChild)
|
|
|
|
defaultslot.appendChild(node)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
toAppend.forEach(node => !defaultslot.hasAttribute("hasupdated") && defaultslot.appendChild(node) )
|
|
|
|
defaultslot.setAttribute("hasupdated","")
|
|
|
|
defaultslot.setAttribute("hasupdated","")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.slotting = false
|
|
|
|
this.slotting = false
|
|
|
|