mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 23:42:23 -04:00
Merge buttons to one OuterButtonGroup
- keeping up the concept of left / right buttons might not be necessary anymore - This might make it easier to display them on mobile, and simplifies the logic
This commit is contained in:
parent
8c931af17c
commit
773f431bb8
3 changed files with 7 additions and 19 deletions
|
@ -1,7 +1,7 @@
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
ul {
|
ul {
|
||||||
padding-inline-start: 0;
|
padding-inline-start: 0;
|
||||||
margin-bottom: 2px;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
li {
|
li {
|
||||||
display: inline;
|
display: inline-block;
|
||||||
|
margin-bottom: 2px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
|
@ -22,14 +22,11 @@
|
||||||
} from "./format";
|
} from "./format";
|
||||||
import { forecolorButton, colorpickerButton } from "./color";
|
import { forecolorButton, colorpickerButton } from "./color";
|
||||||
|
|
||||||
export let leftButtons = [
|
export let buttons = [
|
||||||
[
|
[
|
||||||
{ component: LabelButton, label: "Fields..." },
|
{ component: LabelButton, label: "Fields..." },
|
||||||
{ component: LabelButton, label: "Cards..." },
|
{ component: LabelButton, label: "Cards..." },
|
||||||
],
|
],
|
||||||
];
|
|
||||||
|
|
||||||
export let rightButtons = [
|
|
||||||
[
|
[
|
||||||
boldButton,
|
boldButton,
|
||||||
italicButton,
|
italicButton,
|
||||||
|
@ -53,20 +50,10 @@
|
||||||
|
|
||||||
<ButtonBarOuter>
|
<ButtonBarOuter>
|
||||||
<ButtonBar>
|
<ButtonBar>
|
||||||
{#each leftButtons as leftGroup}
|
{#each buttons as group}
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
{#each leftGroup as leftButton}
|
{#each group as button}
|
||||||
<svelte:component this={leftButton.component} {...leftButton} />
|
<svelte:component this={button.component} {...button} />
|
||||||
{/each}
|
|
||||||
</ButtonGroup>
|
|
||||||
{/each}
|
|
||||||
</ButtonBar>
|
|
||||||
|
|
||||||
<ButtonBar>
|
|
||||||
{#each rightButtons as rightGroup}
|
|
||||||
<ButtonGroup>
|
|
||||||
{#each rightGroup as rightButton}
|
|
||||||
<svelte:component this={rightButton.component} {...rightButton} />
|
|
||||||
{/each}
|
{/each}
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
{/each}
|
{/each}
|
||||||
|
|
Loading…
Reference in a new issue