find widget readonly notes

This commit is contained in:
zadam
2022-05-26 16:29:54 +02:00
parent f250b72563
commit ade77e5fb8
6 changed files with 78 additions and 18 deletions

View File

@@ -123,7 +123,11 @@ export default class FindWidget extends NoteContextAwareWidget {
await this.findNext(e?.shiftKey ? -1 : 1);
e.preventDefault();
return false;
} else if (e.key === 'Escape') {
}
});
this.$findBox.keydown(async e => {
if (e.key === 'Escape') {
await this.closeSearch();
}
});
@@ -239,11 +243,9 @@ export default class FindWidget extends NoteContextAwareWidget {
const totalFound = parseInt(this.$totalFound.text());
const currentFound = parseInt(this.$currentFound.text()) - 1;
if (totalFound > 0) {
await this.handler.cleanup(totalFound, currentFound);
}
this.searchTerm = null;
await this.handler.findBoxClosed(totalFound, currentFound);
}
}