Small speedup/cleanup of some code

This commit is contained in:
djmaze 2021-03-23 14:48:34 +01:00
parent cca0fc15da
commit 4bcfc81830
5 changed files with 24 additions and 40 deletions

View file

@ -1,10 +1,10 @@
@keyframes login-form-shake { @keyframes login-form-shake {
0% {transform: translateX(0);} 0% {transform: translateX(0);}
12.5% {transform: translateX(-6px) rotateY(-5deg)} 12.5% {transform: translateX(-6px)}
37.5% {transform: translateX(5px) rotateY(4deg)} 37.5% {transform: translateX(5px)}
62.5% {transform: translateX(-3px) rotateY(-2deg)} 62.5% {transform: translateX(-3px)}
87.5% {transform: translateX(2px) rotateY(1deg)} 87.5% {transform: translateX(2px)}
100% {transform: translateX(0)} 100% {transform: translateX(0)}
} }

View file

@ -20,6 +20,7 @@ export class AbstractSystemDropDownUserView extends AbstractViewRight {
constructor(name) { constructor(name) {
super(name, 'SystemDropDown'); super(name, 'SystemDropDown');
this.allowAccounts = Settings.capa(Capa.AdditionalAccounts);
this.allowSettings = Settings.capa(Capa.Settings); this.allowSettings = Settings.capa(Capa.Settings);
this.allowHelp = Settings.capa(Capa.Help); this.allowHelp = Settings.capa(Capa.Help);
@ -31,14 +32,11 @@ export class AbstractSystemDropDownUserView extends AbstractViewRight {
this.addObservables({ this.addObservables({
currentAudio: '', currentAudio: '',
accountMenuDropdownTrigger: false, accountMenuDropdownTrigger: false
capaAdditionalAccounts: Settings.capa(Capa.AdditionalAccounts)
}); });
this.allowContacts = AppUserStore.allowContacts(); this.allowContacts = AppUserStore.allowContacts();
this.addAccountClick = this.addAccountClick.bind(this);
addEventListener('audio.stop', () => this.currentAudio('')); addEventListener('audio.stop', () => this.currentAudio(''));
addEventListener('audio.start', e => this.currentAudio(e.detail)); addEventListener('audio.start', e => this.currentAudio(e.detail));
} }
@ -61,27 +59,19 @@ export class AbstractSystemDropDownUserView extends AbstractViewRight {
} }
settingsClick() { settingsClick() {
if (Settings.capa(Capa.Settings)) { this.allowSettings && rl.route.setHash(settings());
rl.route.setHash(settings());
}
} }
settingsHelp() { settingsHelp() {
if (Settings.capa(Capa.Help)) { this.allowHelp && showScreenPopup(KeyboardShortcutsHelpPopupView);
showScreenPopup(KeyboardShortcutsHelpPopupView);
}
} }
addAccountClick() { addAccountClick() {
if (this.capaAdditionalAccounts()) { this.allowAccounts && showScreenPopup(AccountPopupView);
showScreenPopup(AccountPopupView);
}
} }
contactsClick() { contactsClick() {
if (this.allowContacts) { this.allowContacts && showScreenPopup(ContactsPopupView);
showScreenPopup(ContactsPopupView);
}
} }
layoutDesktop() layoutDesktop()

View file

@ -99,7 +99,18 @@ class LoginUserView extends AbstractViewCenter {
submitError: value => value || this.submitErrorAddidional(''), submitError: value => value || this.submitErrorAddidional(''),
signMeType: iValue => this.signMe(LoginSignMeType.DefaultOn === iValue) signMeType: iValue => this.signMe(LoginSignMeType.DefaultOn === iValue),
language: value => {
this.langRequest(true);
translatorReload(false, value).then(
() => {
this.langRequest(false);
this.bSendLanguage = true;
},
() => this.langRequest(false)
);
}
}); });
if (SettingsGet('AdditionalLoginError') && !this.submitError()) { if (SettingsGet('AdditionalLoginError') && !this.submitError()) {
@ -191,22 +202,6 @@ class LoginUserView extends AbstractViewCenter {
this.signMeType(LoginSignMeType.Unused); this.signMeType(LoginSignMeType.Unused);
break; break;
} }
setTimeout(() => {
LanguageStore.language.subscribe((value) => {
this.langRequest(true);
translatorReload(false, value).then(
() => {
this.langRequest(false);
this.bSendLanguage = true;
},
() => {
this.langRequest(false);
}
);
});
}, 50);
} }
submitForm() { submitForm() {

View file

@ -165,8 +165,7 @@ class Application extends \RainLoop\Config\AbstractConfig
'hide_x_mailer_header' => array(true), 'hide_x_mailer_header' => array(true),
'admin_panel_host' => array(''), 'admin_panel_host' => array(''),
'admin_panel_key' => array('admin'), 'admin_panel_key' => array('admin'),
'content_security_policy' => array(''), 'content_security_policy' => array('')
'core_install_access_domain' => array('')
), ),
'ssl' => array( 'ssl' => array(

View file

@ -40,7 +40,7 @@
<!-- /ko --> <!-- /ko -->
<!-- /ko --> <!-- /ko -->
<li class="e-item dividerbar" role="presentation" data-bind="visible: capaAdditionalAccounts"> <li class="e-item dividerbar" role="presentation" data-bind="visible: allowAccounts">
<a class="e-link menuitem" href="#" tabindex="-1" data-bind="click: addAccountClick"> <a class="e-link menuitem" href="#" tabindex="-1" data-bind="click: addAccountClick">
<i class="fontastic"></i> <i class="fontastic"></i>
<span data-i18n="TOP_TOOLBAR/BUTTON_ADD_ACCOUNT"></span> <span data-i18n="TOP_TOOLBAR/BUTTON_ADD_ACCOUNT"></span>