Remove some unused KnockoutJS features

This commit is contained in:
djmaze 2021-09-13 16:20:29 +02:00
parent f09820d0b9
commit 5839bcf62d
7 changed files with 100 additions and 184 deletions

View file

@ -113,15 +113,6 @@
extendCallback = options['extend'];
}
if (dataItemAlias && options && options['noChildContext']) {
var isFunc = typeof(dataItemOrAccessor) == "function" && !ko.isObservable(dataItemOrAccessor);
return new ko.bindingContext(inheritParentVm, this, null, self => {
if (extendCallback)
extendCallback(self);
self[dataItemAlias] = isFunc ? dataItemOrAccessor() : dataItemOrAccessor;
}, options);
}
return new ko.bindingContext(dataItemOrAccessor, this, dataItemAlias, (self, parentContext) => {
// Extend the context hierarchy by setting the appropriate pointers
self['$parentContext'] = parentContext;