import NoteContextAwareWidget from "../note_context_aware_widget.js"; import { t } from "../../services/i18n.js"; const TPL = `
`; export default class FloatingButtons extends NoteContextAwareWidget { doRender() { this.$widget = $(TPL); this.$children = this.$widget.find(".floating-buttons-children"); for (const widget of this.children) { this.$children.append(widget.render()); } } async refreshWithNote(note) { this.toggle(true); this.$widget.find(".show-floating-buttons-button").on("click", () => this.toggle(true)); } toggle(show) { this.$widget.find(".floating-buttons-children").toggleClass("temporarily-hidden", !show); } hideFloatingButtonsCommand() { this.toggle(false); } }