mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 13:56:11 +01:00
add quick search in mobile layout (#2360)
Co-authored-by: jasongwq <jasongwq@126.com>
This commit is contained in:
@@ -52,6 +52,20 @@ export default class QuickSearchWidget extends BasicWidget {
|
||||
|
||||
this.$widget.find('.input-group-prepend').on('shown.bs.dropdown', () => this.search());
|
||||
|
||||
if(utils.isMobile()) {
|
||||
this.$searchString.keydown(e =>{
|
||||
if(e.which==13) {
|
||||
if (this.$dropdownMenu.is(":visible")) {
|
||||
this.search(); // just update already visible dropdown
|
||||
} else {
|
||||
this.$dropdownToggle.dropdown('show');
|
||||
}
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
utils.bindElShortcut(this.$searchString, 'return', () => {
|
||||
if (this.$dropdownMenu.is(":visible")) {
|
||||
this.search(); // just update already visible dropdown
|
||||
|
||||
Reference in New Issue
Block a user