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

View File

@ -9,11 +9,6 @@ import { getDeckOptionsInfo, DeckOptionsState } from "./lib";
import { setupI18n, ModuleName } from "lib/i18n";
import { checkNightMode } from "lib/nightmode";
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";
export async function deckOptions(
@ -49,9 +44,16 @@ export async function deckOptions(
} as any);
}
export const deckConfigComponents = {
SpinBox,
SpinBoxFloat,
EnumSelector,
CheckBox,
import TitledContainer from "./TitledContainer.svelte";
import SpinBoxRow from "./SpinBoxRow.svelte";
import SpinBoxFloatRow from "./SpinBoxFloatRow.svelte";
import EnumSelectorRow from "./EnumSelectorRow.svelte";
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) {
window[key] = globals[key];
}
// but also export as window.anki
window["anki"] = globals;