mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-07-31 04:02:26 +08:00
feat(mermaid): custom title for switch layout button
This commit is contained in:
parent
b54603b7d7
commit
ef9bec9dd4
@ -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">) {
|
||||||
|
@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user