mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 09:58:32 +02:00
api log close button
This commit is contained in:
parent
24e4455e91
commit
47235965d5
@ -7,6 +7,7 @@ const TPL = `
|
|||||||
padding: 15px;
|
padding: 15px;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
max-height: 40%;
|
max-height: 40%;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
|
|
||||||
.hidden-api-log {
|
.hidden-api-log {
|
||||||
@ -17,7 +18,21 @@ const TPL = `
|
|||||||
overflow: auto;
|
overflow: auto;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.close-api-log-button {
|
||||||
|
padding: 5px;
|
||||||
|
border: 1px solid var(--button-border-color);
|
||||||
|
background-color: var(--button-background-color);
|
||||||
|
border-radius: 4px;
|
||||||
|
color: var(--button-text-color);
|
||||||
|
position: absolute;
|
||||||
|
top: 10px;
|
||||||
|
right: 40px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<div class="bx bx-x close-api-log-button" title="Close"></div>
|
||||||
|
|
||||||
<div class="api-log-container"></div>
|
<div class="api-log-container"></div>
|
||||||
</div>`;
|
</div>`;
|
||||||
@ -31,9 +46,11 @@ export default class ApiLogWidget extends NoteContextAwareWidget {
|
|||||||
|
|
||||||
doRender() {
|
doRender() {
|
||||||
this.$widget = $(TPL);
|
this.$widget = $(TPL);
|
||||||
this.$widget.addClass("hidden-api-log");
|
this.toggle(false);
|
||||||
|
|
||||||
this.$logContainer = this.$widget.find('.api-log-container');
|
this.$logContainer = this.$widget.find('.api-log-container');
|
||||||
|
this.$closeButton = this.$widget.find(".close-api-log-button");
|
||||||
|
this.$closeButton.on("click", () => this.toggle(false));
|
||||||
}
|
}
|
||||||
|
|
||||||
async refreshWithNote(note) {
|
async refreshWithNote(note) {
|
||||||
@ -45,10 +62,14 @@ export default class ApiLogWidget extends NoteContextAwareWidget {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.$widget.removeClass("hidden-api-log");
|
this.toggle(true);
|
||||||
|
|
||||||
for (const message of messages) {
|
for (const message of messages) {
|
||||||
this.$logContainer.append(message).append($("<br>"));
|
this.$logContainer.append(message).append($("<br>"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
toggle(show) {
|
||||||
|
this.$widget.toggleClass("hidden-api-log", !show);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user