mirror of
https://github.com/zadam/trilium.git
synced 2025-11-07 05:46:10 +01:00
bring back the possibility to close the floating buttons again, closes #3116
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import Container from "../containers/container.js";
|
||||
import NoteContextAwareWidget from "../note_context_aware_widget.js";
|
||||
|
||||
const TPL = `
|
||||
<div class="floating-buttons">
|
||||
@@ -16,7 +16,7 @@ const TPL = `
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.floating-buttons-children > * {
|
||||
.floating-buttons-children > *:not(.hidden-int):not(.no-content-hidden) {
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
@@ -24,12 +24,16 @@ const TPL = `
|
||||
font-size: 130%;
|
||||
padding: 5px 10px 4px 10px;
|
||||
}
|
||||
|
||||
.floating-buttons.temporarily-hidden {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="floating-buttons-children"></div>
|
||||
</div>`;
|
||||
|
||||
export default class FloatingButtons extends Container {
|
||||
export default class FloatingButtons extends NoteContextAwareWidget {
|
||||
doRender() {
|
||||
this.$widget = $(TPL);
|
||||
this.$children = this.$widget.find(".floating-buttons-children");
|
||||
@@ -38,4 +42,16 @@ export default class FloatingButtons extends Container {
|
||||
this.$children.append(widget.render());
|
||||
}
|
||||
}
|
||||
|
||||
async refreshWithNote(note) {
|
||||
this.toggle(true);
|
||||
}
|
||||
|
||||
toggle(show) {
|
||||
this.$widget.toggleClass("temporarily-hidden", !show);
|
||||
}
|
||||
|
||||
hideFloatingButtonsCommand() {
|
||||
this.toggle(false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user