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