mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 12:47:11 -05:00
add option to hide revert buttons
This commit is contained in:
parent
c74a373cdc
commit
2860e628ee
2 changed files with 8 additions and 2 deletions
|
|
@ -18,6 +18,7 @@
|
|||
export let choices: Choice<T>[];
|
||||
export let disabled: boolean = false;
|
||||
export let disabledChoices: T[] = [];
|
||||
export let hideRevert: boolean = false;
|
||||
</script>
|
||||
|
||||
<Row --cols={13}>
|
||||
|
|
@ -27,7 +28,9 @@
|
|||
<Col --col-size={6} {breakpoint}>
|
||||
<ConfigInput>
|
||||
<EnumSelector bind:value {choices} {disabled} {disabledChoices} />
|
||||
<RevertButton slot="revert" bind:value {defaultValue} />
|
||||
{#if !hideRevert}
|
||||
<RevertButton slot="revert" bind:value {defaultValue} />
|
||||
{/if}
|
||||
</ConfigInput>
|
||||
</Col>
|
||||
</Row>
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@
|
|||
export let value: boolean;
|
||||
export let defaultValue: boolean;
|
||||
export let disabled: boolean = false;
|
||||
export let hideRevert: boolean = false;
|
||||
|
||||
const id = Math.random().toString(36).substring(2);
|
||||
</script>
|
||||
|
|
@ -22,7 +23,9 @@
|
|||
<Col --col-justify="flex-end">
|
||||
<ConfigInput grow={false}>
|
||||
<Switch {id} bind:value {disabled} />
|
||||
<RevertButton slot="revert" bind:value {defaultValue} />
|
||||
{#if !hideRevert}
|
||||
<RevertButton slot="revert" bind:value {defaultValue} />
|
||||
{/if}
|
||||
</ConfigInput>
|
||||
</Col>
|
||||
</Row>
|
||||
|
|
|
|||
Loading…
Reference in a new issue