mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-11-03 02:48:49 +03:00
KnockoutJS don't scramble exportDependencies. controlsDescendantBindings, createChildContext
This commit is contained in:
parent
a8e38a998f
commit
766d3eaa98
8 changed files with 16 additions and 16 deletions
|
|
@ -1,7 +1,7 @@
|
|||
ko.bindingHandlers['html'] = {
|
||||
'init': () => (
|
||||
// Prevent binding on the dynamically-injected HTML (as developers are unlikely to expect that, and it has security implications)
|
||||
{ controlsDescendantBindings: true }
|
||||
{ 'controlsDescendantBindings': true }
|
||||
),
|
||||
'update': (element, valueAccessor) => {
|
||||
// setHtml will unwrap the value if needed
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ function makeWithIfBinding(bindingKey, isWith, isNot) {
|
|||
var savedNodes, contextOptions = {}, needAsyncContext;
|
||||
|
||||
if (isWith) {
|
||||
contextOptions = { exportDependencies: true };
|
||||
contextOptions = { 'exportDependencies': true };
|
||||
}
|
||||
|
||||
needAsyncContext = allBindings['has'](ko.bindingEvent.descendantsComplete);
|
||||
|
|
@ -26,7 +26,7 @@ function makeWithIfBinding(bindingKey, isWith, isNot) {
|
|||
contextOptions['dataDependency'] = ko.dependencyDetection.computed();
|
||||
|
||||
childContext = isWith
|
||||
? bindingContext.createChildContext(typeof value == "function" ? value : valueAccessor, contextOptions)
|
||||
? bindingContext['createChildContext'](typeof value == "function" ? value : valueAccessor, contextOptions)
|
||||
: (ko.dependencyDetection.getDependenciesCount()
|
||||
? bindingContext['extend'](null, contextOptions)
|
||||
: bindingContext
|
||||
|
|
@ -50,7 +50,7 @@ function makeWithIfBinding(bindingKey, isWith, isNot) {
|
|||
|
||||
}, { disposeWhenNodeIsRemoved: element });
|
||||
|
||||
return { controlsDescendantBindings: true };
|
||||
return { 'controlsDescendantBindings': true };
|
||||
}
|
||||
};
|
||||
ko.virtualElements.allowedBindings[bindingKey] = true;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ ko.bindingHandlers['options'] = {
|
|||
}
|
||||
|
||||
// Ensures that the binding processor doesn't try to bind the options
|
||||
return { controlsDescendantBindings: true };
|
||||
return { 'controlsDescendantBindings': true };
|
||||
},
|
||||
'update': (element, valueAccessor, allBindings) => {
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ ko.bindingHandlers['text'] = {
|
|||
'init': () => (
|
||||
// Prevent binding on the dynamically-injected text node (as developers are unlikely to expect that, and it has security implications).
|
||||
// It should also make things faster, as we no longer have to consider whether the text node might be bindable.
|
||||
{ controlsDescendantBindings: true }
|
||||
{ 'controlsDescendantBindings': true }
|
||||
),
|
||||
'update': (element, valueAccessor) => {
|
||||
if (8 === element.nodeType) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue