mirror of
https://github.com/zadam/trilium.git
synced 2025-11-15 09:45:52 +01:00
Merge branch 'master' into next61
# Conflicts: # package-lock.json # package.json # src/public/app/components/note_context.js # src/public/app/services/open.js # src/public/app/widgets/buttons/note_actions.js # src/public/app/widgets/find_in_code.js # src/public/app/widgets/type_widgets/canvas.js # src/services/options.js
This commit is contained in:
@@ -146,20 +146,31 @@ export default class FindWidget extends NoteContextAwareWidget {
|
||||
return;
|
||||
}
|
||||
|
||||
this.handler = await this.getHandler();
|
||||
|
||||
const selectedText = window.getSelection().toString() || "";
|
||||
|
||||
this.$findBox.show();
|
||||
this.$input.focus();
|
||||
this.handler = await this.getHandler();
|
||||
|
||||
const isAlreadyVisible = this.$findBox.is(":visible");
|
||||
|
||||
if (isAlreadyVisible) {
|
||||
if (selectedText) {
|
||||
this.$input.val(selectedText);
|
||||
}
|
||||
|
||||
if (this.$input.val()) {
|
||||
await this.performFind();
|
||||
}
|
||||
|
||||
this.$input.select();
|
||||
} else {
|
||||
this.$totalFound.text(0);
|
||||
this.$currentFound.text(0);
|
||||
const searchTerm = await this.handler.getInitialSearchTerm();
|
||||
this.$input.val(searchTerm || "");
|
||||
if (searchTerm !== "") {
|
||||
this.$input.val(selectedText);
|
||||
|
||||
if (selectedText) {
|
||||
this.$input.select();
|
||||
await this.performFind();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user