cancel button in the entry selection view

This commit is contained in:
antelle 2021-04-28 23:37:15 +02:00
parent b07cea9049
commit a0c0b7b195
No known key found for this signature in database
GPG Key ID: 63C9777AAB7C563C
4 changed files with 15 additions and 8 deletions

View File

@ -804,7 +804,6 @@
"selectEntryHeader": "Select entry",
"selectEntryEnterHint": "use the highlighted entry",
"selectEntryEscHint": "cancel",
"selectEntryTypingHint": "Start typing to filter",
"selectEntryContains": "Contains text",
"selectEntrySubdomains": "Subdomains"

View File

@ -25,7 +25,8 @@ class SelectEntryView extends View {
'click .select-entry__header-filter-clear': 'clearFilterText',
'click .select-entry__item': 'itemClicked',
'contextmenu .select-entry__item': 'itemRightClicked',
'click .select-entry__filter': 'filterClicked'
'click .select-entry__filter': 'filterClicked',
'click .select-entry__cancel-btn': 'cancelClicked'
};
result = null;
@ -158,11 +159,7 @@ class SelectEntryView extends View {
}
escPressed() {
if (this.model.filter.text) {
this.clearFilterText();
} else {
this.cancelAndClose();
}
this.cancelAndClose();
}
enterPressed() {
@ -394,6 +391,10 @@ class SelectEntryView extends View {
this.render();
}
cancelClicked() {
this.cancelAndClose();
}
}
Object.assign(SelectEntryView.prototype, Scrollable);

View File

@ -144,4 +144,9 @@
padding-left: 0;
}
}
&__buttons {
display: flex;
justify-content: flex-end;
margin-top: $small-spacing;
}
}

View File

@ -15,7 +15,6 @@
<div class="select-entry__hint-text"><span class="shortcut">{{shiftSymbol}} {{keyEnter}}</span>: {{res 'autoTypeSelectionHintShift'}}</div>
{{else}}
<div class="select-entry__hint-text"><span class="shortcut">{{keyEnter}}</span>: {{res 'selectEntryEnterHint'}}</div>
<div class="select-entry__hint-text"><span class="shortcut">{{keyEsc}}</span>: {{res 'selectEntryEscHint'}}</div>
<div class="select-entry__hint-text">{{res 'selectEntryTypingHint'}}</div>
{{/if}}
</div>
@ -45,4 +44,7 @@
</div>
<div class="scroller__bar-wrapper"><div class="scroller__bar"></div></div>
</div>
<div class="select-entry__buttons">
<button class="btn btn-error select-entry__cancel-btn">{{res 'alertCancel'}} ({{res 'keyEsc'}})</button>
</div>
</div>