Improve and cleanup isMobile

This commit is contained in:
djmaze 2021-02-15 16:05:38 +01:00
parent 10f9ce39d9
commit b1c7bd2c50
15 changed files with 27 additions and 43 deletions

View file

@ -1090,7 +1090,6 @@ class ComposePopupView extends AbstractViewPopup {
}
setFocusInPopup() {
// isMobile() ||
setTimeout(() => {
if (!this.to()) {
this.to.focused(true);

View file

@ -160,9 +160,7 @@ class FilterPopupView extends AbstractViewPopup {
}
onShowWithDelay() {
if (this.isNew() && this.filter()/* && !isMobile()*/) {
this.filter().nameFocused(true);
}
this.isNew() && this.filter() && this.filter().nameFocused(true);
}
}

View file

@ -72,7 +72,6 @@ class FolderCreatePopupView extends AbstractViewPopup {
}
onShowWithDelay() {
// isMobile() ||
this.folderNameFocused(true);
}
}

View file

@ -166,9 +166,7 @@ class IdentityPopupView extends AbstractViewPopup {
}
onShowWithDelay() {
if (!this.owner()/* && !isMobile()*/) {
this.emailFocused(true);
}
this.owner() || this.emailFocused(true);
}
onHideWithDelay() {

View file

@ -49,7 +49,6 @@ class TwoFactorTestPopupView extends AbstractViewPopup {
}
onShowWithDelay() {
// isMobile() ||
this.codeFocused(true);
}
}

View file

@ -19,11 +19,9 @@ export class MenuSettingsUserView extends AbstractViewLeft {
}
onBuild(dom) {
if (isMobile()) {
dom.addEventListener('click', event =>
isMobile() && dom.addEventListener('click', event =>
event.target.closestWithin('.b-settings-menu .e-item.selectable', dom) && leftPanelDisabled(true)
);
}
shortcuts.add('arrowup,arrowdown', '', KeyState.Settings,
settingsMenuKeysHandler(dom.querySelectorAll('.b-settings-menu .e-item')));