mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-10-31 01:23:32 +03:00
Bugfix: compose mail select contacts for cc/bcc failed
Cleanup: Inputosaurus and Knockout Change: Knockout domData now uses WeakMap Replaced: Knockout domManipulation with a documentFragment
This commit is contained in:
parent
fe7c7fede4
commit
ebe2c0536f
23 changed files with 410 additions and 889 deletions
|
|
@ -38,6 +38,3 @@ ko.bindingHandlers['hasfocus'] = {
|
|||
}
|
||||
};
|
||||
ko.expressionRewriting.twoWayBindings['hasfocus'] = true;
|
||||
|
||||
ko.bindingHandlers['hasFocus'] = ko.bindingHandlers['hasfocus']; // Make "hasFocus" an alias
|
||||
ko.expressionRewriting.twoWayBindings['hasFocus'] = 'hasfocus';
|
||||
|
|
|
|||
|
|
@ -3,7 +3,20 @@ ko.bindingHandlers['html'] = {
|
|||
// Prevent binding on the dynamically-injected HTML (as developers are unlikely to expect that, and it has security implications)
|
||||
return { 'controlsDescendantBindings': true };
|
||||
},
|
||||
'update': (element, valueAccessor) =>
|
||||
'update': (element, valueAccessor) => {
|
||||
// setHtml will unwrap the value if needed
|
||||
ko.utils.setHtml(element, valueAccessor())
|
||||
ko.utils.emptyDomNode(element);
|
||||
|
||||
// There's no legitimate reason to display a stringified observable without unwrapping it, so we'll unwrap it
|
||||
let html = ko.utils.unwrapObservable(valueAccessor());
|
||||
|
||||
if (html != null) {
|
||||
if (typeof html != 'string')
|
||||
html = html.toString();
|
||||
|
||||
const template = document.createElement('template');
|
||||
template.innerHTML = html;
|
||||
element.appendChild(template.content);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue