Merge pull request #1280 from hgiesel/addonimprov2

Export via components for Deck Options
This commit is contained in:
Damien Elmes 2021-07-07 09:53:05 +10:00 committed by GitHub
commit 7141f795fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 16 deletions

View File

@ -57,8 +57,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<ConfigSelector {state} /> <ConfigSelector {state} />
<Container api={options} class="g-1 mb-3 mt-3"> <div class="multi-column">
<div class="multi-column"> <Container api={options} class="g-1 mb-3 mt-3">
<Item> <Item>
<DailyLimits {state} api={dailyLimits} /> <DailyLimits {state} api={dailyLimits} />
</Item> </Item>
@ -96,17 +96,17 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
<Item> <Item>
<AdvancedOptions {state} api={advancedOptions} /> <AdvancedOptions {state} api={advancedOptions} />
</Item> </Item>
</div> </Container>
</Container> </div>
<style lang="scss"> <style lang="scss">
.multi-column { .multi-column :global(.container) {
column-count: 2; column-count: 2;
column-gap: 5em; column-gap: 5em;
} }
@media (max-width: 1000px) { @media (max-width: 1000px) {
.multi-column { .multi-column :global(.container) {
column-count: 1; column-count: 1;
} }
} }

View File

@ -9,11 +9,6 @@ import { getDeckOptionsInfo, DeckOptionsState } from "./lib";
import { setupI18n, ModuleName } from "lib/i18n"; import { setupI18n, ModuleName } from "lib/i18n";
import { checkNightMode } from "lib/nightmode"; import { checkNightMode } from "lib/nightmode";
import DeckOptionsPage from "./DeckOptionsPage.svelte"; import DeckOptionsPage from "./DeckOptionsPage.svelte";
import SpinBox from "./SpinBox.svelte";
import SpinBoxFloat from "./SpinBoxFloat.svelte";
import EnumSelector from "./EnumSelector.svelte";
import CheckBox from "./CheckBox.svelte";
import { nightModeKey, touchDeviceKey, modalsKey } from "components/context-keys"; import { nightModeKey, touchDeviceKey, modalsKey } from "components/context-keys";
export async function deckOptions( export async function deckOptions(
@ -49,9 +44,16 @@ export async function deckOptions(
} as any); } as any);
} }
export const deckConfigComponents = { import TitledContainer from "./TitledContainer.svelte";
SpinBox, import SpinBoxRow from "./SpinBoxRow.svelte";
SpinBoxFloat, import SpinBoxFloatRow from "./SpinBoxFloatRow.svelte";
EnumSelector, import EnumSelectorRow from "./EnumSelectorRow.svelte";
CheckBox, import SwitchRow from "./SwitchRow.svelte";
export const components = {
TitledContainer,
SpinBoxRow,
SpinBoxFloatRow,
EnumSelectorRow,
SwitchRow,
}; };

View File

@ -6,3 +6,6 @@ import * as globals from "./index";
for (const key in globals) { for (const key in globals) {
window[key] = globals[key]; window[key] = globals[key];
} }
// but also export as window.anki
window["anki"] = globals;