mirror of
https://github.com/the-djmaze/snappymail.git
synced 2025-09-29 00:14:31 +08:00
KnockoutJS simplify applyBindingsToNodeInternal
This commit is contained in:
parent
33f0dfd3b2
commit
a40e6484a1
1 changed files with 2 additions and 6 deletions
|
@ -236,7 +236,7 @@ function applyBindingsToNodeAndDescendantsInternal(bindingContext, nodeVerified)
|
|||
// (1) We need to store the binding info for the node (all element nodes)
|
||||
// (2) It might have bindings (e.g., it has a data-bind attribute, or it's a marker for a containerless template)
|
||||
if (isElement || ko.bindingProvider.nodeHasBindings(nodeVerified))
|
||||
bindingContextForDescendants = applyBindingsToNodeInternal(nodeVerified, null, bindingContext)['bindingContextForDescendants'];
|
||||
bindingContextForDescendants = applyBindingsToNodeInternal(nodeVerified, null, bindingContext);
|
||||
|
||||
// Don't want bindings that operate on text nodes to mutate <script> and <textarea> contents,
|
||||
// because it's unexpected and a potential XSS issue.
|
||||
|
@ -402,11 +402,7 @@ function applyBindingsToNodeInternal(node, sourceBindings, bindingContext) {
|
|||
});
|
||||
}
|
||||
|
||||
var shouldBindDescendants = bindingHandlerThatControlsDescendantBindings === undefined;
|
||||
return {
|
||||
'shouldBindDescendants': shouldBindDescendants,
|
||||
'bindingContextForDescendants': shouldBindDescendants && contextToExtend
|
||||
};
|
||||
return bindingHandlerThatControlsDescendantBindings === undefined && contextToExtend;
|
||||
}
|
||||
|
||||
ko.storedBindingContextForNode = node => {
|
||||
|
|
Loading…
Add table
Reference in a new issue