mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-04 06:57:03 +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
|
|
@ -102,7 +102,7 @@
|
|||
// Ensure we've got a proper binding context to work with
|
||||
var bindingContext = (dataOrBindingContext instanceof ko.bindingContext)
|
||||
? dataOrBindingContext
|
||||
: new ko.bindingContext(dataOrBindingContext, null, null, { exportDependencies: true });
|
||||
: new ko.bindingContext(dataOrBindingContext, null, null, { "exportDependencies": true });
|
||||
|
||||
var templateName = resolveTemplateName(template, bindingContext['$data'], bindingContext);
|
||||
executeTemplate(targetNodeOrNodeArray, true, templateName, bindingContext, options);
|
||||
|
|
@ -122,7 +122,7 @@
|
|||
// This will be called by setDomNodeChildrenFromArrayMapping to get the nodes to add to targetNode
|
||||
var executeTemplateForArrayItem = (arrayValue, index) => {
|
||||
// Support selecting template as a function of the data being rendered
|
||||
arrayItemContext = parentBindingContext.createChildContext(arrayValue, {
|
||||
arrayItemContext = parentBindingContext['createChildContext'](arrayValue, {
|
||||
'extend': context => context['$index'] = index
|
||||
});
|
||||
|
||||
|
|
@ -247,8 +247,8 @@
|
|||
// Render once for this single data point (or use the viewModel if no data was provided)
|
||||
var innerBindingContext = bindingContext;
|
||||
if ('data' in options) {
|
||||
innerBindingContext = bindingContext.createChildContext(options['data'], {
|
||||
exportDependencies: true
|
||||
innerBindingContext = bindingContext['createChildContext'](options['data'], {
|
||||
'exportDependencies': true
|
||||
});
|
||||
}
|
||||
templateComputed = renderTemplate(template, innerBindingContext, options, element);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue