Remove useless clearPopup() functions

This commit is contained in:
djmaze 2021-11-03 14:58:34 +01:00
parent ba895ba887
commit 2a7348081a
9 changed files with 20 additions and 82 deletions

View file

@ -61,10 +61,14 @@ class AccountPopupView extends AbstractViewPopup {
return true;
}
clearPopup() {
this.isNew(true);
this.email('');
onShow(account) {
if (account && account.canBeEdit()) {
this.isNew(false);
this.email(account.email);
} else {
this.isNew(true);
this.email('');
}
this.password('');
this.emailError(false);
@ -74,14 +78,6 @@ class AccountPopupView extends AbstractViewPopup {
this.submitError('');
this.submitErrorAdditional('');
}
onShow(account) {
this.clearPopup();
if (account && account.canBeEdit()) {
this.isNew(false);
this.email(account.email);
}
}
}
export { AccountPopupView, AccountPopupView as default };

View file

@ -82,15 +82,11 @@ class AddOpenPgpKeyPopupView extends AbstractViewPopup {
return true;
}
clearPopup() {
onShow() {
this.key('');
this.keyError(false);
this.keyErrorMessage('');
}
onShow() {
this.clearPopup();
}
}
export { AddOpenPgpKeyPopupView, AddOpenPgpKeyPopupView as default };

View file

@ -114,7 +114,7 @@ class AdvancedSearchPopupView extends AbstractViewPopup {
return result.replace(/^&+/, '');
}
clearPopup() {
onShow(search) {
this.from('');
this.to('');
this.subject('');
@ -124,10 +124,7 @@ class AdvancedSearchPopupView extends AbstractViewPopup {
this.hasAttachment(false);
this.starred(false);
this.unseen(false);
}
onShow(search) {
this.clearPopup();
this.parseSearchStringValue(search);
}
}

View file

@ -21,15 +21,6 @@ class AskPopupView extends AbstractViewPopup {
this.bDisabeCloseOnEsc = true;
}
clearPopup() {
this.askDesc('');
this.yesButton(i18n('POPUPS_ASK/BUTTON_YES'));
this.noButton(i18n('POPUPS_ASK/BUTTON_NO'));
this.fYesAction = null;
this.fNoAction = null;
}
yesClick() {
this.cancelCommand();
@ -52,21 +43,11 @@ class AskPopupView extends AbstractViewPopup {
* @returns {void}
*/
onShow(askDesc, fYesFunc = null, fNoFunc = null, yesButton = '', noButton = '', isFocusYesOnShow = true) {
this.clearPopup();
this.fYesAction = fYesFunc || null;
this.fNoAction = fNoFunc || null;
this.askDesc(askDesc || '');
if (yesButton) {
this.yesButton(yesButton);
}
if (noButton) {
this.noButton(noButton);
}
this.yesButton(yesButton || i18n('POPUPS_ASK/BUTTON_YES'));
this.noButton(noButton || i18n('POPUPS_ASK/BUTTON_NO'));
this.fYesAction = fYesFunc;
this.fNoAction = fNoFunc;
this.bFocusYesOnShow = !!isFocusYesOnShow;
}

View file

@ -147,15 +147,8 @@ class FilterPopupView extends AbstractViewPopup {
}
}
clearPopup() {
this.isNew(true);
this.fTrueCallback = null;
this.filter(null);
}
onShow(oFilter, fTrueCallback, bEdit) {
this.clearPopup();
this.isNew(!bEdit);
this.fTrueCallback = fTrueCallback;
this.filter(oFilter);
@ -164,8 +157,6 @@ class FilterPopupView extends AbstractViewPopup {
this.selectedFolderValue(oFilter.actionValue());
}
this.isNew(!bEdit);
if (!bEdit && oFilter) {
oFilter.nameFocused(true);
}

View file

@ -65,16 +65,9 @@ class FolderClearPopupView extends AbstractViewPopup {
}
}
clearPopup() {
this.clearingProcess(false);
this.selectedFolder(null);
}
onShow(folder) {
this.clearPopup();
if (folder) {
this.selectedFolder(folder);
}
this.clearingProcess(false);
this.selectedFolder(folder || null);
}
}

View file

@ -60,14 +60,10 @@ class FolderCreatePopupView extends AbstractViewPopup {
return /^[^\\/]+$/g.test(sName);
}
clearPopup() {
onShow() {
this.folderName('');
this.selectedParentValue('');
}
onShow() {
this.clearPopup();
}
}
export { FolderCreatePopupView, FolderCreatePopupView as default };

View file

@ -86,7 +86,7 @@ class NewOpenPgpKeyPopupView extends AbstractViewPopup {
}
}
clearPopup() {
onShow() {
this.name('');
this.password('');
@ -96,10 +96,6 @@ class NewOpenPgpKeyPopupView extends AbstractViewPopup {
this.submitError('');
}
onShow() {
this.clearPopup();
}
}
export { NewOpenPgpKeyPopupView, NewOpenPgpKeyPopupView as default };

View file

@ -12,10 +12,6 @@ class ViewOpenPgpKeyPopupView extends AbstractViewPopup {
});
}
clearPopup() {
this.key('');
}
selectKey() {
const el = this.keyDom();
if (el) {
@ -28,11 +24,7 @@ class ViewOpenPgpKeyPopupView extends AbstractViewPopup {
}
onShow(openPgpKey) {
this.clearPopup();
if (openPgpKey) {
this.key(openPgpKey.armor);
}
this.key(openPgpKey ? openPgpKey.armor : '');
}
onBuild() {