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", "selectEntryHeader": "Select entry",
"selectEntryEnterHint": "use the highlighted entry", "selectEntryEnterHint": "use the highlighted entry",
"selectEntryEscHint": "cancel",
"selectEntryTypingHint": "Start typing to filter", "selectEntryTypingHint": "Start typing to filter",
"selectEntryContains": "Contains text", "selectEntryContains": "Contains text",
"selectEntrySubdomains": "Subdomains" "selectEntrySubdomains": "Subdomains"

View File

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

View File

@ -144,4 +144,9 @@
padding-left: 0; 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> <div class="select-entry__hint-text"><span class="shortcut">{{shiftSymbol}} {{keyEnter}}</span>: {{res 'autoTypeSelectionHintShift'}}</div>
{{else}} {{else}}
<div class="select-entry__hint-text"><span class="shortcut">{{keyEnter}}</span>: {{res 'selectEntryEnterHint'}}</div> <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> <div class="select-entry__hint-text">{{res 'selectEntryTypingHint'}}</div>
{{/if}} {{/if}}
</div> </div>
@ -45,4 +44,7 @@
</div> </div>
<div class="scroller__bar-wrapper"><div class="scroller__bar"></div></div> <div class="scroller__bar-wrapper"><div class="scroller__bar"></div></div>
</div> </div>
<div class="select-entry__buttons">
<button class="btn btn-error select-entry__cancel-btn">{{res 'alertCancel'}} ({{res 'keyEsc'}})</button>
</div>
</div> </div>