mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-09-20 23:55:55 +08:00
improved HtmlEditor html source handling
This commit is contained in:
parent
88f7b3d345
commit
c64ec1b2d8
2
dev/External/SquireUI.js
vendored
2
dev/External/SquireUI.js
vendored
|
@ -476,7 +476,7 @@ class SquireUI
|
|||
}
|
||||
|
||||
getData() {
|
||||
return trimLines(this.squire.getHTML());
|
||||
return 'source' == this.mode ? this.plain.value : trimLines(this.squire.getHTML());
|
||||
}
|
||||
|
||||
setData(html) {
|
||||
|
|
10
dev/External/User/ko.js
vendored
10
dev/External/User/ko.js
vendored
|
@ -52,7 +52,7 @@ Object.assign(ko.bindingHandlers, {
|
|||
fUpdateEditorValue();
|
||||
};
|
||||
|
||||
if (ko.isObservable(fValue) && HtmlEditor) {
|
||||
if (ko.isObservable(fValue)) {
|
||||
editor = new HtmlEditor(element, fUpdateKoValue, fOnReady, fUpdateKoValue);
|
||||
|
||||
fValue.__fetchEditorValue = fUpdateKoValue;
|
||||
|
@ -81,11 +81,9 @@ Object.assign(ko.bindingHandlers, {
|
|||
onChange: value => fValue(value)
|
||||
});
|
||||
|
||||
if (focused) {
|
||||
focused.subscribe(value =>
|
||||
element.addresses[value ? 'focus' : 'blur']()
|
||||
);
|
||||
}
|
||||
focused?.subscribe(value =>
|
||||
element.addresses[value ? 'focus' : 'blur']()
|
||||
);
|
||||
},
|
||||
update: (element, fValueAccessor) => {
|
||||
element.addresses.value = ko.unwrap(fValueAccessor());
|
||||
|
|
Loading…
Reference in a new issue