mirror of
https://github.com/zadam/trilium.git
synced 2025-11-30 04:24:24 +01:00
fix(launch_bar/calendar): clicking on the edges would dismiss modal
This commit is contained in:
parent
ca7bbefbdc
commit
351fe5848f
@ -4,6 +4,10 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.dropdown-menu:not(.static).calendar-dropdown-menu {
|
||||||
|
padding: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
.calendar-dropdown-widget {
|
.calendar-dropdown-widget {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|||||||
@ -345,7 +345,7 @@ body[dir=ltr] #launcher-container {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
.calendar-dropdown-widget {
|
.calendar-dropdown-widget {
|
||||||
padding: 12px;
|
padding: 18px;
|
||||||
color: var(--calendar-color);
|
color: var(--calendar-color);
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -110,7 +110,7 @@ export default class CalendarWidget extends RightDropdownButtonWidget {
|
|||||||
private weekNotes: string[] = [];
|
private weekNotes: string[] = [];
|
||||||
|
|
||||||
constructor(title: string = "", icon: string = "") {
|
constructor(title: string = "", icon: string = "") {
|
||||||
super(title, icon, DROPDOWN_TPL);
|
super(title, icon, DROPDOWN_TPL, "calendar-dropdown-menu");
|
||||||
}
|
}
|
||||||
|
|
||||||
doRender() {
|
doRender() {
|
||||||
|
|||||||
@ -24,14 +24,16 @@ export default class RightDropdownButtonWidget extends BasicWidget {
|
|||||||
protected dropdown!: Dropdown;
|
protected dropdown!: Dropdown;
|
||||||
protected $tooltip!: JQuery<HTMLElement>;
|
protected $tooltip!: JQuery<HTMLElement>;
|
||||||
protected tooltip!: Tooltip;
|
protected tooltip!: Tooltip;
|
||||||
|
private dropdownClass?: string;
|
||||||
public $dropdownContent!: JQuery<HTMLElement>;
|
public $dropdownContent!: JQuery<HTMLElement>;
|
||||||
|
|
||||||
constructor(title: string, iconClass: string, dropdownTpl: string) {
|
constructor(title: string, iconClass: string, dropdownTpl: string, dropdownClass?: string) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this.iconClass = iconClass;
|
this.iconClass = iconClass;
|
||||||
this.title = title;
|
this.title = title;
|
||||||
this.dropdownTpl = dropdownTpl;
|
this.dropdownTpl = dropdownTpl;
|
||||||
|
this.dropdownClass = dropdownClass;
|
||||||
|
|
||||||
this.settings = {
|
this.settings = {
|
||||||
titlePlacement: "right"
|
titlePlacement: "right"
|
||||||
@ -41,6 +43,9 @@ export default class RightDropdownButtonWidget extends BasicWidget {
|
|||||||
doRender() {
|
doRender() {
|
||||||
this.$widget = $(TPL);
|
this.$widget = $(TPL);
|
||||||
this.$dropdownMenu = this.$widget.find(".dropdown-menu");
|
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], {
|
this.dropdown = Dropdown.getOrCreateInstance(this.$widget.find("[data-bs-toggle='dropdown']")[0], {
|
||||||
popperConfig: {
|
popperConfig: {
|
||||||
placement: this.settings.titlePlacement,
|
placement: this.settings.titlePlacement,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user