Remove unused KnockoutJS code

This commit is contained in:
djmaze 2021-08-10 15:16:21 +02:00
parent 3a32a09f2a
commit 89075b18bf
3 changed files with 88 additions and 106 deletions

View file

@ -269,16 +269,12 @@
}
function applyBindingsToDescendantsInternal(bindingContext, elementOrVirtualElement) {
var nextInQueue = ko.virtualElements.firstChild(elementOrVirtualElement);
var currentChild, nextInQueue = ko.virtualElements.firstChild(elementOrVirtualElement);
if (nextInQueue) {
var currentChild;
while (currentChild = nextInQueue) {
// Keep a record of the next child *before* applying bindings, in case the binding removes the current child from its position
nextInQueue = ko.virtualElements.nextSibling(currentChild);
applyBindingsToNodeAndDescendantsInternal(bindingContext, currentChild);
}
while (currentChild = nextInQueue) {
// Keep a record of the next child *before* applying bindings, in case the binding removes the current child from its position
nextInQueue = ko.virtualElements.nextSibling(currentChild);
applyBindingsToNodeAndDescendantsInternal(bindingContext, currentChild);
}
ko.bindingEvent.notify(elementOrVirtualElement, ko.bindingEvent.childrenComplete);
}
@ -485,11 +481,6 @@
ko.applyBindingAccessorsToNode = (node, bindings, viewModelOrBindingContext) =>
applyBindingsToNodeInternal(node, bindings, getBindingContext(viewModelOrBindingContext));
ko.applyBindingsToNode = (node, bindings, viewModelOrBindingContext) => {
var context = getBindingContext(viewModelOrBindingContext);
return ko.applyBindingAccessorsToNode(node, makeBindingAccessors(bindings, context, node), context);
};
ko.applyBindingsToDescendants = (viewModelOrBindingContext, rootNode) => {
if (rootNode.nodeType === 1 || rootNode.nodeType === 8)
applyBindingsToDescendantsInternal(getBindingContext(viewModelOrBindingContext), rootNode);