Skip to content

Commit

Permalink
Fixed layout for mobile editor (#304)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcokreeft87 authored Oct 15, 2023
1 parent f341c97 commit 9b5ae5e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
7 changes: 6 additions & 1 deletion formulaone-card.js

Large diffs are not rendered by default.

Binary file modified formulaone-card.js.gz
Binary file not shown.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "formulaone-card",
"version": "1.8.7",
"version": "1.8.8",
"description": "Frontend card for Home Assistant to display Formula One data",
"main": "index.js",
"scripts": {
Expand Down
17 changes: 11 additions & 6 deletions src/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class FormulaOneCardEditor extends EditorForm {
{ label: "Row limit", configValue: "row_limit", type: FormControlType.Textbox },
{ label: "Date locale", configValue: "date_locale", type: FormControlType.Textbox }
]
},
},
{
label: "Countdown Type",
hidden: this._config.card_type !== FormulaOneCardType.Countdown,
Expand All @@ -48,9 +48,9 @@ export class FormulaOneCardEditor extends EditorForm {
{ label: "Next race delay", configValue: "next_race_delay", type: FormControlType.Textbox },
]
},
{
{
hidden: this._config.card_type !== FormulaOneCardType.Schedule,
controls: [{ label: "Previous race", configValue: "previous_race", type: FormControlType.Dropdown, items: getDropdownOptionsFromEnum(PreviousRaceDisplay) }]
controls: [{ label: "Previous race", configValue: "previous_race", type: FormControlType.Dropdown, items: getDropdownOptionsFromEnum(PreviousRaceDisplay) }]
},
{
label: "Standings",
Expand All @@ -61,14 +61,14 @@ export class FormulaOneCardEditor extends EditorForm {
{ label: "Show flag", configValue: "standings.show_flag", type: FormControlType.Switch },
{ label: "Show teamlogo", configValue: "standings.show_teamlogo", type: FormControlType.Switch }
]
},
},
{
label: "Weather",
hidden: this._config.card_type !== FormulaOneCardType.NextRace && this._config.card_type !== FormulaOneCardType.Countdown,
controls: [
{ label: "Show weather", configValue: "show_weather", type: FormControlType.Switch }
]
},
},
{
cssClass: 'side-by-side',
hidden: (this._config.card_type !== FormulaOneCardType.NextRace && this._config.card_type !== FormulaOneCardType.Countdown) || !this._config.show_weather,
Expand All @@ -89,7 +89,7 @@ export class FormulaOneCardEditor extends EditorForm {
controls: [
{ label: "Tabs order", configValue: "tabs_order", type: FormControlType.Textbox }
]
},
},
]);
}

Expand Down Expand Up @@ -122,6 +122,11 @@ export class FormulaOneCardEditor extends EditorForm {
.hidden {
display: none;
}
@media (max-width: 600px) {
.side-by-side > .form-control {
width: 48%;
}
}
`;
}
}

0 comments on commit 9b5ae5e

Please sign in to comment.