mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-02 22:17:03 +03:00
KnockoutJS drop unused bindingRewriteValidators
This commit is contained in:
parent
0f0f60e456
commit
df8f13e359
4 changed files with 0 additions and 16 deletions
12
vendors/knockout/src/templating/templating.js
vendored
12
vendors/knockout/src/templating/templating.js
vendored
|
|
@ -259,17 +259,5 @@
|
|||
}
|
||||
};
|
||||
|
||||
// Anonymous templates can't be rewritten. Give a nice error message if you try to do it.
|
||||
ko.expressionRewriting.bindingRewriteValidators['template'] = bindingValue => {
|
||||
var parsedBindingValue = ko.expressionRewriting.parseObjectLiteral(bindingValue);
|
||||
|
||||
if ((parsedBindingValue.length == 1) && parsedBindingValue[0]['unknown'])
|
||||
return null; // It looks like a string literal, not an object literal, so treat it as a named template (which is allowed for rewriting)
|
||||
|
||||
if (ko.expressionRewriting.keyValueArrayContainsKey(parsedBindingValue, "name"))
|
||||
return null; // Named templates can be rewritten, so return "no error"
|
||||
return "This template engine does not support anonymous templates nested within its templates";
|
||||
};
|
||||
|
||||
ko.virtualElements.allowedBindings['template'] = true;
|
||||
})();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue