mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-11 00:14:50 +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
4
dev/External/User/ko.js
vendored
4
dev/External/User/ko.js
vendored
|
|
@ -68,7 +68,7 @@ ko.bindingHandlers.emailsTags = {
|
|||
inputDelimiters = [',', ';', '\n'];
|
||||
|
||||
element.inputosaurus = new window.Inputosaurus(element, {
|
||||
focusCallback: value => fValue && fValue.focused && fValue.focused(!!value),
|
||||
focusCallback: value => fValue.focused && fValue.focused(!!value),
|
||||
autoCompleteSource: fAllBindings.autoCompleteSource || null,
|
||||
splitHook: value => {
|
||||
const v = value.trim();
|
||||
|
|
@ -89,7 +89,7 @@ ko.bindingHandlers.emailsTags = {
|
|||
}
|
||||
});
|
||||
|
||||
if (fValue && fValue.focused && fValue.focused.subscribe) {
|
||||
if (fValue.focused && fValue.focused.subscribe) {
|
||||
fValue.focused.subscribe(value =>
|
||||
element.inputosaurus[value ? 'focus' : 'blur']()
|
||||
);
|
||||
|
|
|
|||
|
|
@ -142,16 +142,11 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
identitiesDropdownTrigger: false,
|
||||
|
||||
to: '',
|
||||
toFocused: false,
|
||||
cc: '',
|
||||
ccFocused: false,
|
||||
bcc: '',
|
||||
bccFocused: false,
|
||||
replyTo: '',
|
||||
replyToFocused: false,
|
||||
|
||||
subject: '',
|
||||
subjectFocused: false,
|
||||
|
||||
isHtml: false,
|
||||
|
||||
|
|
@ -197,20 +192,13 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
|
||||
// this.to.subscribe((v) => console.log(v));
|
||||
|
||||
ko.computed(() => {
|
||||
switch (true) {
|
||||
case this.toFocused():
|
||||
this.sLastFocusedField = 'to';
|
||||
break;
|
||||
case this.ccFocused():
|
||||
this.sLastFocusedField = 'cc';
|
||||
break;
|
||||
case this.bccFocused():
|
||||
this.sLastFocusedField = 'bcc';
|
||||
break;
|
||||
// no default
|
||||
}
|
||||
}).extend({ notify: 'always' });
|
||||
// Used by ko.bindingHandlers.emailsTags
|
||||
this.to.focused = ko.observable(false);
|
||||
this.to.focused.subscribe(value => value && (this.sLastFocusedField = 'to'));
|
||||
this.cc.focused = ko.observable(false);
|
||||
this.cc.focused.subscribe(value => value && (this.sLastFocusedField = 'cc'));
|
||||
this.bcc.focused = ko.observable(false);
|
||||
this.bcc.focused.subscribe(value => value && (this.sLastFocusedField = 'bcc'));
|
||||
|
||||
this.attachments = ko.observableArray();
|
||||
|
||||
|
|
@ -688,7 +676,7 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
|
||||
this.bSkipNextHide = false;
|
||||
|
||||
this.toFocused(false);
|
||||
this.to.focused(false);
|
||||
|
||||
rl.route.on();
|
||||
|
||||
|
|
@ -1131,11 +1119,9 @@ class ComposePopupView extends AbstractViewPopup {
|
|||
// rl.settings.app('mobile') ||
|
||||
setTimeout(() => {
|
||||
if (!this.to()) {
|
||||
this.toFocused(true);
|
||||
} else if (this.oEditor) {
|
||||
if (!this.toFocused()) {
|
||||
this.oEditor.focus();
|
||||
}
|
||||
this.to.focused(true);
|
||||
} else if (this.oEditor && !this.to.focused()) {
|
||||
this.oEditor.focus();
|
||||
}
|
||||
}, 100);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue