mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-27 18:12:29 +08:00
feat(quick_search): align popup to bottom-center (closes #1679)
This commit is contained in:
parent
7fba2dfb8b
commit
60217d4e4f
@ -25,6 +25,7 @@
|
|||||||
* The following dialogs are now accessible: bulk actions, branch prefix, include note, add link, sort child notes, note type selector, move/clone to, import/export, markdown import, note revisions, info dialog.
|
* The following dialogs are now accessible: bulk actions, branch prefix, include note, add link, sort child notes, note type selector, move/clone to, import/export, markdown import, note revisions, info dialog.
|
||||||
* Delete notes now requests confirmation.
|
* Delete notes now requests confirmation.
|
||||||
* Modals now have a safe margin on their bottom and are scrollable.
|
* Modals now have a safe margin on their bottom and are scrollable.
|
||||||
|
* [Center Search results under quick search bar](https://github.com/TriliumNext/Notes/issues/1679)
|
||||||
|
|
||||||
## 🌍 Internationalization
|
## 🌍 Internationalization
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ const TPL = /*html*/`
|
|||||||
<button class="btn btn-outline-secondary search-button" type="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<button class="btn btn-outline-secondary search-button" type="button" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||||
<span class="bx bx-search"></span>
|
<span class="bx bx-search"></span>
|
||||||
</button>
|
</button>
|
||||||
<div class="dropdown-menu dropdown-menu-left tn-dropdown-list"></div>
|
<div class="dropdown-menu tn-dropdown-list"></div>
|
||||||
</div>
|
</div>
|
||||||
<input type="text" class="form-control form-control-sm search-string" placeholder="${t("quick-search.placeholder")}">
|
<input type="text" class="form-control form-control-sm search-string" placeholder="${t("quick-search.placeholder")}">
|
||||||
</div>`;
|
</div>`;
|
||||||
@ -56,15 +56,17 @@ export default class QuickSearchWidget extends BasicWidget {
|
|||||||
|
|
||||||
doRender() {
|
doRender() {
|
||||||
this.$widget = $(TPL);
|
this.$widget = $(TPL);
|
||||||
this.dropdown = Dropdown.getOrCreateInstance(this.$widget.find("[data-bs-toggle='dropdown']")[0], {
|
|
||||||
popperConfig: {
|
|
||||||
strategy: "fixed"
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
this.$searchString = this.$widget.find(".search-string");
|
this.$searchString = this.$widget.find(".search-string");
|
||||||
this.$dropdownMenu = this.$widget.find(".dropdown-menu");
|
this.$dropdownMenu = this.$widget.find(".dropdown-menu");
|
||||||
|
|
||||||
|
this.dropdown = Dropdown.getOrCreateInstance(this.$widget.find("[data-bs-toggle='dropdown']")[0], {
|
||||||
|
reference: this.$searchString[0],
|
||||||
|
popperConfig: {
|
||||||
|
strategy: "fixed",
|
||||||
|
placement: "bottom"
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.$widget.find(".input-group-prepend").on("shown.bs.dropdown", () => this.search());
|
this.$widget.find(".input-group-prepend").on("shown.bs.dropdown", () => this.search());
|
||||||
|
|
||||||
if (utils.isMobile()) {
|
if (utils.isMobile()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user