mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Bugfix: <!-- ko text: valueAccessor --> failed
https://knockoutjs.com/documentation/text-binding.html#note-3-using-text-without-a-container-element
This commit is contained in:
parent
467b4a7913
commit
74f74163c6
3 changed files with 31 additions and 21 deletions
|
|
@ -4,7 +4,12 @@ ko.bindingHandlers['text'] = {
|
|||
// It should also make things faster, as we no longer have to consider whether the text node might be bindable.
|
||||
return { 'controlsDescendantBindings': true };
|
||||
},
|
||||
'update': (element, valueAccessor) =>
|
||||
ko.utils.setTextContent(element, valueAccessor())
|
||||
'update': (element, valueAccessor) => {
|
||||
if (8 === element.nodeType) {
|
||||
element.text || element.after(element.text = document.createTextNode(''));
|
||||
element = element.text;
|
||||
}
|
||||
ko.utils.setTextContent(element, valueAccessor());
|
||||
}
|
||||
};
|
||||
ko.virtualElements.allowedBindings['text'] = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue