feat(mermaid): custom title for switch layout button

This commit is contained in:
Elian Doran 2025-03-22 10:48:12 +02:00
parent b54603b7d7
commit ef9bec9dd4
No known key found for this signature in database
2 changed files with 12 additions and 2 deletions

View File

@ -1,11 +1,11 @@
import type { EventData } from "../../components/app_context.js"; import type { EventData } from "../../components/app_context.js";
import { t } from "../../services/i18n.js";
import options from "../../services/options.js"; import options from "../../services/options.js";
import NoteContextAwareWidget from "../note_context_aware_widget.js"; import NoteContextAwareWidget from "../note_context_aware_widget.js";
const TPL = ` const TPL = `
<button type="button" <button type="button"
class="switch-layout-button" class="switch-layout-button">
title="Switch layout">
<span class="bx"></span> <span class="bx"></span>
</button> </button>
`; `;
@ -36,6 +36,12 @@ export default class SwitchSplitOrientationButton extends NoteContextAwareWidget
$icon $icon
.toggleClass("bxs-dock-bottom", upcomingOrientation === "vertical") .toggleClass("bxs-dock-bottom", upcomingOrientation === "vertical")
.toggleClass("bxs-dock-left", upcomingOrientation === "horizontal"); .toggleClass("bxs-dock-left", upcomingOrientation === "horizontal");
if (upcomingOrientation === "vertical") {
this.$widget.attr("title", t("switch_layout_button.title_vertical"));
} else {
this.$widget.attr("title", t("switch_layout_button.title_horizontal"));
}
} }
entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) { entitiesReloadedEvent({ loadResults }: EventData<"entitiesReloaded">) {

View File

@ -1703,5 +1703,9 @@
"content_language": { "content_language": {
"title": "Content languages", "title": "Content languages",
"description": "Select one or more languages that should appear in the language selection in the Basic Properties section of a read-only or editable text note. This will allow features such as spell-checking or right-to-left support." "description": "Select one or more languages that should appear in the language selection in the Basic Properties section of a read-only or editable text note. This will allow features such as spell-checking or right-to-left support."
},
"switch_layout_button": {
"title_vertical": "Move editing pane to the bottom",
"title_horizontal": "Move editing pane to the left"
} }
} }