Add tooltip for Toggly sticky icon

This commit is contained in:
Henrik Giesel 2021-08-03 06:02:29 +02:00
parent d7232212a8
commit b6aa59f2c7
3 changed files with 9 additions and 2 deletions

View File

@ -39,6 +39,7 @@ editing-subscript = Subscript
editing-superscript = Superscript
editing-tags = Tags
editing-to-make-a-cloze-deletion-on = To make a cloze deletion on an existing note, you need to change it to a cloze type first, via 'Notes>Change Note Type'
editing-toggle-sticky = Toggle sticky
editing-underline-text = Underline text
editing-unordered-list = Unordered list
editing-warning-cloze-deletions-will-not-work = Warning, cloze deletions will not work until you switch the type at the top to Cloze.

View File

@ -191,7 +191,7 @@ export function setFormat(cmd: string, arg?: string, nosave = false): void {
}
}
const i18n = setupI18n({
export const i18n = setupI18n({
modules: [
ModuleName.EDITING,
ModuleName.KEYBOARD,

View File

@ -2,10 +2,12 @@
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import type { EditorField } from "./editor-field";
import * as tr from "lib/i18n";
import { registerShortcut } from "lib/shortcuts";
import { bridgeCommand } from "./lib";
import { getCurrentField, forEditorField } from ".";
import { appendInParentheses } from "./helpers";
import { getCurrentField, forEditorField, i18n } from ".";
import pinIcon from "./pin-angle.svg";
function toggleStickyCurrentField() {
@ -37,6 +39,10 @@ export class LabelContainer extends HTMLDivElement {
super();
this.className = "d-flex justify-content-between";
i18n.then(() => {
this.title = appendInParentheses(tr.editingToggleSticky(), "F9");
});
this.label = document.createElement("span");
this.label.className = "fieldname";
this.appendChild(this.label);