mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -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">
|
||||
import * as tr from "lib/i18n";
|
||||
import { disabledKey } from "components/contextKeys";
|
||||
import { inCodableKey } from "./contextKeys";
|
||||
|
||||
import IconButton from "components/IconButton.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>
|
||||
<WithContext key={disabledKey} let:context={disabled}>
|
||||
<IconButton
|
||||
tooltip={`${tr.editingClozeDeletion()} (${shortcutLabel})`}
|
||||
{disabled}
|
||||
on:click={onCloze}
|
||||
on:mount={createShortcut}
|
||||
>
|
||||
{@html bracketsIcon}
|
||||
</IconButton>
|
||||
<WithContext key={inCodableKey} let:context={inCodable}>
|
||||
<IconButton
|
||||
tooltip={`${tr.editingClozeDeletion()} (${shortcutLabel})`}
|
||||
disabled={inCodable || disabled}
|
||||
on:click={onCloze}
|
||||
on:mount={createShortcut}
|
||||
>
|
||||
{@html bracketsIcon}
|
||||
</IconButton>
|
||||
</WithContext>
|
||||
</WithContext>
|
||||
</WithShortcut>
|
||||
|
|
|
@ -82,18 +82,22 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
</ButtonGroupItem>
|
||||
|
||||
<ButtonGroupItem id="cloze">
|
||||
<ClozeButton />
|
||||
<OnlyEditable>
|
||||
<ClozeButton />
|
||||
</OnlyEditable>
|
||||
</ButtonGroupItem>
|
||||
|
||||
<ButtonGroupItem>
|
||||
<WithDropdownMenu let:createDropdown let:menuId>
|
||||
<WithContext key={disabledKey} let:context={disabled}>
|
||||
<IconButton
|
||||
{disabled}
|
||||
on:mount={(event) => createDropdown(event.detail.button)}
|
||||
>
|
||||
{@html functionIcon}
|
||||
</IconButton>
|
||||
<OnlyEditable let:disabled={inCodable}>
|
||||
<IconButton
|
||||
disabled={disabled || inCodable}
|
||||
on:mount={(event) => createDropdown(event.detail.button)}
|
||||
>
|
||||
{@html functionIcon}
|
||||
</IconButton>
|
||||
</OnlyEditable>
|
||||
</WithContext>
|
||||
|
||||
<DropdownMenu id={menuId}>
|
||||
|
|
Loading…
Reference in a new issue