mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 22:42:25 -04:00
disable cloze&math buttons in html mode
Following on from 8a07d3161d
Keeping them active seems to encourage users to experiment:
https://forums.ankiweb.net/t/cloze-deleting-html-svg/11011
This commit is contained in:
parent
33c9ae211a
commit
18843e711d
2 changed files with 22 additions and 15 deletions
|
@ -5,6 +5,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
<script lang="typescript">
|
<script lang="typescript">
|
||||||
import * as tr from "lib/i18n";
|
import * as tr from "lib/i18n";
|
||||||
import { disabledKey } from "components/contextKeys";
|
import { disabledKey } from "components/contextKeys";
|
||||||
|
import { inCodableKey } from "./contextKeys";
|
||||||
|
|
||||||
import IconButton from "components/IconButton.svelte";
|
import IconButton from "components/IconButton.svelte";
|
||||||
import WithShortcut from "components/WithShortcut.svelte";
|
import WithShortcut from "components/WithShortcut.svelte";
|
||||||
|
@ -45,13 +46,15 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
<WithShortcut shortcut={"Control+Alt?+Shift+C"} let:createShortcut let:shortcutLabel>
|
<WithShortcut shortcut={"Control+Alt?+Shift+C"} let:createShortcut let:shortcutLabel>
|
||||||
<WithContext key={disabledKey} let:context={disabled}>
|
<WithContext key={disabledKey} let:context={disabled}>
|
||||||
|
<WithContext key={inCodableKey} let:context={inCodable}>
|
||||||
<IconButton
|
<IconButton
|
||||||
tooltip={`${tr.editingClozeDeletion()} (${shortcutLabel})`}
|
tooltip={`${tr.editingClozeDeletion()} (${shortcutLabel})`}
|
||||||
{disabled}
|
disabled={inCodable || disabled}
|
||||||
on:click={onCloze}
|
on:click={onCloze}
|
||||||
on:mount={createShortcut}
|
on:mount={createShortcut}
|
||||||
>
|
>
|
||||||
{@html bracketsIcon}
|
{@html bracketsIcon}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
</WithContext>
|
</WithContext>
|
||||||
|
</WithContext>
|
||||||
</WithShortcut>
|
</WithShortcut>
|
||||||
|
|
|
@ -82,18 +82,22 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
</ButtonGroupItem>
|
</ButtonGroupItem>
|
||||||
|
|
||||||
<ButtonGroupItem id="cloze">
|
<ButtonGroupItem id="cloze">
|
||||||
|
<OnlyEditable>
|
||||||
<ClozeButton />
|
<ClozeButton />
|
||||||
|
</OnlyEditable>
|
||||||
</ButtonGroupItem>
|
</ButtonGroupItem>
|
||||||
|
|
||||||
<ButtonGroupItem>
|
<ButtonGroupItem>
|
||||||
<WithDropdownMenu let:createDropdown let:menuId>
|
<WithDropdownMenu let:createDropdown let:menuId>
|
||||||
<WithContext key={disabledKey} let:context={disabled}>
|
<WithContext key={disabledKey} let:context={disabled}>
|
||||||
|
<OnlyEditable let:disabled={inCodable}>
|
||||||
<IconButton
|
<IconButton
|
||||||
{disabled}
|
disabled={disabled || inCodable}
|
||||||
on:mount={(event) => createDropdown(event.detail.button)}
|
on:mount={(event) => createDropdown(event.detail.button)}
|
||||||
>
|
>
|
||||||
{@html functionIcon}
|
{@html functionIcon}
|
||||||
</IconButton>
|
</IconButton>
|
||||||
|
</OnlyEditable>
|
||||||
</WithContext>
|
</WithContext>
|
||||||
|
|
||||||
<DropdownMenu id={menuId}>
|
<DropdownMenu id={menuId}>
|
||||||
|
|
Loading…
Reference in a new issue