mirror of
https://github.com/ankitects/anki.git
synced 2025-11-16 17:47:11 -05:00
Don't show toggle when field is collapsed
This commit is contained in:
parent
37c74e4fca
commit
cf90c71e59
2 changed files with 14 additions and 9 deletions
|
|
@ -362,6 +362,8 @@ the AddCards dialog) should be implemented in the user of this component.
|
||||||
</RichTextInput>
|
</RichTextInput>
|
||||||
|
|
||||||
<PlainTextBadge
|
<PlainTextBadge
|
||||||
|
collapsed={richTextsHidden[index] &&
|
||||||
|
plainTextsHidden[index]}
|
||||||
bind:off={plainTextsHidden[index]}
|
bind:off={plainTextsHidden[index]}
|
||||||
on:toggle={() => {
|
on:toggle={() => {
|
||||||
plainTextsHidden[index] = !plainTextsHidden[index];
|
plainTextsHidden[index] = !plainTextsHidden[index];
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
export let off = false;
|
export let off = false;
|
||||||
|
export let collapsed = false;
|
||||||
|
|
||||||
function toggle() {
|
function toggle() {
|
||||||
dispatch("toggle");
|
dispatch("toggle");
|
||||||
|
|
@ -26,7 +27,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
let width = 0;
|
let width = 0;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="clickable" style="--width: {width}px" on:click|stopPropagation={toggle}>
|
{#if !collapsed}
|
||||||
|
<div class="clickable" style="--width: {width}px" on:click|stopPropagation={toggle}>
|
||||||
<span
|
<span
|
||||||
class:off
|
class:off
|
||||||
class:on={!off}
|
class:on={!off}
|
||||||
|
|
@ -34,7 +36,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
class:highlighted={!off}
|
class:highlighted={!off}
|
||||||
bind:clientWidth={width}
|
bind:clientWidth={width}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
.clickable {
|
.clickable {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue