Skip to content

Build your personal knowledge base with Trilium Notes

fix(launch_bar/calendar): clicking on the edges would dismiss modal

Elian Doran351fe5848f09
diff --git a/apps/client/src/stylesheets/calendar.css b/apps/client/src/stylesheets/calendar.css
index 48f01a9b83..314439846c 100644
--- a/apps/client/src/stylesheets/calendar.css
+++ b/apps/client/src/stylesheets/calendar.css
@@ -4,6 +4,10 @@
box-sizing: border-box;
}
+.dropdown-menu:not(.static).calendar-dropdown-menu {
+ padding: 0 !important;
+}
+
.calendar-dropdown-widget {
margin: 0 auto;
overflow: hidden;
diff --git a/apps/client/src/stylesheets/theme-next/shell.css b/apps/client/src/stylesheets/theme-next/shell.css
index 19ac274778..83517e9ad8 100644
--- a/apps/client/src/stylesheets/theme-next/shell.css
+++ b/apps/client/src/stylesheets/theme-next/shell.css
@@ -345,7 +345,7 @@ body[dir=ltr] #launcher-container {
*/
.calendar-dropdown-widget {
- padding: 12px;
+ padding: 18px;
color: var(--calendar-color);
user-select: none;
}
diff --git a/apps/client/src/widgets/buttons/calendar.ts b/apps/client/src/widgets/buttons/calendar.ts
index 548e9fd116..f03a4da3aa 100644
--- a/apps/client/src/widgets/buttons/calendar.ts
+++ b/apps/client/src/widgets/buttons/calendar.ts
@@ -110,7 +110,7 @@ export default class CalendarWidget extends RightDropdownButtonWidget {
private weekNotes: string[] = [];
constructor(title: string = "", icon: string = "") {
- super(title, icon, DROPDOWN_TPL);
+ super(title, icon, DROPDOWN_TPL, "calendar-dropdown-menu");
}
doRender() {
diff --git a/apps/client/src/widgets/buttons/right_dropdown_button.ts b/apps/client/src/widgets/buttons/right_dropdown_button.ts
index 7c43f14af3..4b3505bc97 100644
--- a/apps/client/src/widgets/buttons/right_dropdown_button.ts
+++ b/apps/client/src/widgets/buttons/right_dropdown_button.ts
@@ -24,14 +24,16 @@ export default class RightDropdownButtonWidget extends BasicWidget {
protected dropdown!: Dropdown;
protected $tooltip!: JQuery<HTMLElement>;
protected tooltip!: Tooltip;
+ private dropdownClass?: string;
public $dropdownContent!: JQuery<HTMLElement>;
- constructor(title: string, iconClass: string, dropdownTpl: string) {
+ constructor(title: string, iconClass: string, dropdownTpl: string, dropdownClass?: string) {
super();
this.iconClass = iconClass;
this.title = title;
this.dropdownTpl = dropdownTpl;
+ this.dropdownClass = dropdownClass;
this.settings = {
titlePlacement: "right"
@@ -41,6 +43,9 @@ export default class RightDropdownButtonWidget extends BasicWidget {
doRender() {
this.$widget = $(TPL);
this.$dropdownMenu = this.$widget.find(".dropdown-menu");
+ if (this.dropdownClass) {
+ this.$dropdownMenu.addClass(this.dropdownClass);
+ }
this.dropdown = Dropdown.getOrCreateInstance(this.$widget.find("[data-bs-toggle='dropdown']")[0], {
popperConfig: {
placement: this.settings.titlePlacement,