mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Remove the openDropdownTrigger and replace some with a better toggle
This commit is contained in:
parent
9d876d1146
commit
df7888e3a6
8 changed files with 8 additions and 27 deletions
14
dev/External/User/ko.js
vendored
14
dev/External/User/ko.js
vendored
|
|
@ -3,7 +3,6 @@ import ko from 'ko';
|
||||||
import { HtmlEditor } from 'Common/Html';
|
import { HtmlEditor } from 'Common/Html';
|
||||||
import { timeToNode } from 'Common/Translator';
|
import { timeToNode } from 'Common/Translator';
|
||||||
import { doc, elementById, addEventsListeners, dropdowns, leftPanelDisabled } from 'Common/Globals';
|
import { doc, elementById, addEventsListeners, dropdowns, leftPanelDisabled } from 'Common/Globals';
|
||||||
import { dropdownsDetectVisibility } from 'Common/UtilsUser';
|
|
||||||
import { EmailAddressesComponent } from 'Component/EmailAddresses';
|
import { EmailAddressesComponent } from 'Component/EmailAddresses';
|
||||||
import { ThemeStore } from 'Stores/Theme';
|
import { ThemeStore } from 'Stores/Theme';
|
||||||
import { dropFilesInFolder } from 'Common/Folders';
|
import { dropFilesInFolder } from 'Common/Folders';
|
||||||
|
|
@ -247,18 +246,5 @@ Object.assign(ko.bindingHandlers, {
|
||||||
dropdowns.push(element);
|
dropdowns.push(element);
|
||||||
element.ddBtn = new BSN.Dropdown(element.querySelector('.dropdown-toggle'));
|
element.ddBtn = new BSN.Dropdown(element.querySelector('.dropdown-toggle'));
|
||||||
}
|
}
|
||||||
},
|
|
||||||
|
|
||||||
openDropdownTrigger: {
|
|
||||||
update: (element, fValueAccessor) => {
|
|
||||||
if (ko.unwrap(fValueAccessor())) {
|
|
||||||
const el = element.ddBtn;
|
|
||||||
el.open || el.toggle();
|
|
||||||
// el.focus();
|
|
||||||
|
|
||||||
dropdownsDetectVisibility();
|
|
||||||
fValueAccessor()(false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -207,7 +207,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
||||||
this.allowSpellcheck = SettingsUserStore.allowSpellcheck;
|
this.allowSpellcheck = SettingsUserStore.allowSpellcheck;
|
||||||
|
|
||||||
addObservablesTo(this, {
|
addObservablesTo(this, {
|
||||||
identitiesDropdownTrigger: false,
|
identitiesMenu: false,
|
||||||
|
|
||||||
from: '',
|
from: '',
|
||||||
to: '',
|
to: '',
|
||||||
|
|
@ -1136,7 +1136,7 @@ export class ComposePopupView extends AbstractViewPopup {
|
||||||
addShortcut('w', 'meta', ScopeCompose, ()=>false);
|
addShortcut('w', 'meta', ScopeCompose, ()=>false);
|
||||||
|
|
||||||
addShortcut('m', 'meta', ScopeCompose, () => {
|
addShortcut('m', 'meta', ScopeCompose, () => {
|
||||||
this.identitiesDropdownTrigger(true);
|
this.identitiesMenu().ddBtn.toggle();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,9 +112,6 @@ export class MailMessageList extends AbstractViewRight {
|
||||||
this.userUsageProc = FolderUserStore.quotaPercentage;
|
this.userUsageProc = FolderUserStore.quotaPercentage;
|
||||||
|
|
||||||
addObservablesTo(this, {
|
addObservablesTo(this, {
|
||||||
moreDropdownTrigger: false,
|
|
||||||
sortDropdownTrigger: false,
|
|
||||||
|
|
||||||
focusSearch: false
|
focusSearch: false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -105,8 +105,6 @@ export class MailMessageView extends AbstractViewRight {
|
||||||
showAttachmentControls: !!Local.get(ClientSideKeyNameMessageAttachmentControls),
|
showAttachmentControls: !!Local.get(ClientSideKeyNameMessageAttachmentControls),
|
||||||
downloadAsZipLoading: false,
|
downloadAsZipLoading: false,
|
||||||
showFullInfo: '1' === Local.get(ClientSideKeyNameMessageHeaderFullInfo),
|
showFullInfo: '1' === Local.get(ClientSideKeyNameMessageHeaderFullInfo),
|
||||||
moreDropdownTrigger: false,
|
|
||||||
|
|
||||||
// viewer
|
// viewer
|
||||||
viewFromShort: '',
|
viewFromShort: '',
|
||||||
dkimData: ['none', '', '']
|
dkimData: ['none', '', '']
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ export class SystemDropDownUserView extends AbstractViewRight {
|
||||||
|
|
||||||
addObservablesTo(this, {
|
addObservablesTo(this, {
|
||||||
currentAudio: '',
|
currentAudio: '',
|
||||||
accountMenuDropdownTrigger: false
|
accountMenu: false
|
||||||
});
|
});
|
||||||
|
|
||||||
this.allowContacts = AppUserStore.allowContacts();
|
this.allowContacts = AppUserStore.allowContacts();
|
||||||
|
|
@ -115,7 +115,7 @@ export class SystemDropDownUserView extends AbstractViewRight {
|
||||||
registerShortcut('m', '', [ScopeMessageList, ScopeMessageView, ScopeSettings], () => {
|
registerShortcut('m', '', [ScopeMessageList, ScopeMessageView, ScopeSettings], () => {
|
||||||
if (!this.viewModelDom.hidden) {
|
if (!this.viewModelDom.hidden) {
|
||||||
// exitFullscreen();
|
// exitFullscreen();
|
||||||
this.accountMenuDropdownTrigger(true);
|
this.accountMenu().ddBtn.toggle();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
</a>
|
</a>
|
||||||
<a class="btn fontastic" data-bind="command: deleteCommand" data-i18n="[title]GLOBAL/DELETE">🗑</a>
|
<a class="btn fontastic" data-bind="command: deleteCommand" data-i18n="[title]GLOBAL/DELETE">🗑</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group dropdown" data-bind="registerBootstrapDropdown: true, openDropdownTrigger: moreDropdownTrigger">
|
<div class="btn-group dropdown" data-bind="registerBootstrapDropdown: true">
|
||||||
<a id="more-list-dropdown-id" class="btn dropdown-toggle fontastic" href="#" tabindex="-1" data-i18n="[title]GLOBAL/MORE">☰</a>
|
<a id="more-list-dropdown-id" class="btn dropdown-toggle fontastic" href="#" tabindex="-1" data-i18n="[title]GLOBAL/MORE">☰</a>
|
||||||
<menu class="dropdown-menu" role="menu" aria-labelledby="more-list-dropdown-id">
|
<menu class="dropdown-menu" role="menu" aria-labelledby="more-list-dropdown-id">
|
||||||
<li role="presentation" data-bind="click: listUnsetSeen, css: {'disabled': !messageList.hasCheckedOrSelected()}">
|
<li role="presentation" data-bind="click: listUnsetSeen, css: {'disabled': !messageList.hasCheckedOrSelected()}">
|
||||||
|
|
@ -71,7 +71,7 @@
|
||||||
<div class="btn-group dropdown onCheckedHide" data-bind="visible: !sortSupported()">
|
<div class="btn-group dropdown onCheckedHide" data-bind="visible: !sortSupported()">
|
||||||
<div id="no-sort-list" class="btn fontastic" data-i18n="[title]MESSAGE_LIST/NO_SORT">✖⬇</div>
|
<div id="no-sort-list" class="btn fontastic" data-i18n="[title]MESSAGE_LIST/NO_SORT">✖⬇</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group dropdown onCheckedHide" data-bind="visible: sortSupported(), registerBootstrapDropdown: true, openDropdownTrigger: sortDropdownTrigger">
|
<div class="btn-group dropdown onCheckedHide" data-bind="visible: sortSupported(), registerBootstrapDropdown: true">
|
||||||
<a id="sort-list-dropdown-id" class="btn dropdown-toggle fontastic" href="#" tabindex="-1" data-i18n="[title]MESSAGE_LIST/SORT" data-bind="text: sortText">⬇</a>
|
<a id="sort-list-dropdown-id" class="btn dropdown-toggle fontastic" href="#" tabindex="-1" data-i18n="[title]MESSAGE_LIST/SORT" data-bind="text: sortText">⬇</a>
|
||||||
<menu class="dropdown-menu" role="menu" aria-labelledby="sort-list-dropdown-id">
|
<menu class="dropdown-menu" role="menu" aria-labelledby="sort-list-dropdown-id">
|
||||||
<li role="presentation" data-sort="" data-bind="click: changeSort">
|
<li role="presentation" data-sort="" data-bind="click: changeSort">
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@
|
||||||
<!-- /ko -->
|
<!-- /ko -->
|
||||||
<span class="e-identity" data-bind="hidden: allowIdentities, text: from"></span>
|
<span class="e-identity" data-bind="hidden: allowIdentities, text: from"></span>
|
||||||
<!-- ko if: 1 < identitiesOptions().length -->
|
<!-- ko if: 1 < identitiesOptions().length -->
|
||||||
<div class="dropdown" style="display:inline-block" data-bind="registerBootstrapDropdown: true, openDropdownTrigger: identitiesDropdownTrigger">
|
<div class="dropdown" style="display:inline-block" data-bind="registerBootstrapDropdown: true, initDom: identitiesMenu">
|
||||||
<a class="dropdown-toggle" href="#" tabindex="-1" id="identity-toggle" role="button"></a>
|
<a class="dropdown-toggle" href="#" tabindex="-1" id="identity-toggle" role="button"></a>
|
||||||
<menu class="dropdown-menu right-edge" role="menu" aria-labelledby="identity-toggle" data-bind="foreach: identitiesOptions">
|
<menu class="dropdown-menu right-edge" role="menu" aria-labelledby="identity-toggle" data-bind="foreach: identitiesOptions">
|
||||||
<li role="presentation">
|
<li role="presentation">
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<div class="playIcon"><div></div></div>
|
<div class="playIcon"><div></div></div>
|
||||||
<i class="stopIcon fontastic">⏸</i>
|
<i class="stopIcon fontastic">⏸</i>
|
||||||
</div>
|
</div>
|
||||||
<div class="btn-group dropdown" data-bind="registerBootstrapDropdown: true, openDropdownTrigger: accountMenuDropdownTrigger">
|
<div class="btn-group dropdown" data-bind="registerBootstrapDropdown: true, initDom: accountMenu">
|
||||||
<a id="top-system-dropdown-id" href="#" tabindex="-1" class="btn single btn-block dropdown-toggle">
|
<a id="top-system-dropdown-id" href="#" tabindex="-1" class="btn single btn-block dropdown-toggle">
|
||||||
<span class="accountPlace hide-mobile" data-bind="text: accountName(), title: accountEmail"></span>
|
<span class="accountPlace hide-mobile" data-bind="text: accountName(), title: accountEmail"></span>
|
||||||
<i class="fontastic" data-bind="css: {'icon-spinner': accountsLoading()}">👤</i>
|
<i class="fontastic" data-bind="css: {'icon-spinner': accountsLoading()}">👤</i>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue