2021-06-10 13:30:39 +02:00
|
|
|
<!--
|
|
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
-->
|
|
|
|
<script lang="ts">
|
|
|
|
import * as tr from "lib/i18n";
|
|
|
|
import type { ChangeNotetypeState } from "./lib";
|
2021-06-24 16:44:08 +02:00
|
|
|
import { withButton } from "components/helpers";
|
2021-06-10 13:30:39 +02:00
|
|
|
|
|
|
|
import ButtonGroup from "components/ButtonGroup.svelte";
|
|
|
|
import ButtonGroupItem from "components/ButtonGroupItem.svelte";
|
|
|
|
|
|
|
|
import LabelButton from "components/LabelButton.svelte";
|
|
|
|
import WithShortcut from "components/WithShortcut.svelte";
|
|
|
|
|
|
|
|
export let state: ChangeNotetypeState;
|
|
|
|
|
|
|
|
function save(): void {
|
|
|
|
if (document.activeElement instanceof HTMLElement) {
|
|
|
|
document.activeElement.blur();
|
|
|
|
}
|
|
|
|
state.save();
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<ButtonGroup>
|
|
|
|
<ButtonGroupItem>
|
|
|
|
<WithShortcut shortcut={"Control+Enter"} let:createShortcut let:shortcutLabel>
|
|
|
|
<LabelButton
|
|
|
|
theme="primary"
|
|
|
|
on:click={() => save()}
|
|
|
|
tooltip={shortcutLabel}
|
2021-06-24 16:44:08 +02:00
|
|
|
on:mount={withButton(createShortcut)}
|
|
|
|
>{tr.actionsSave()}</LabelButton>
|
2021-06-10 13:30:39 +02:00
|
|
|
</WithShortcut>
|
|
|
|
</ButtonGroupItem>
|
|
|
|
</ButtonGroup>
|