mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Mobile view calendar improvements (#19218)
* Mobile view calendar improvements * Remove very narrow * Revert default choice
This commit is contained in:
parent
155098bc41
commit
ebdbab81d3
@ -188,7 +188,7 @@ export class HAFullCalendar extends LitElement {
|
||||
</ha-icon-button-next>
|
||||
</div>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<div class="controls buttons">
|
||||
<mwc-button
|
||||
outlined
|
||||
class="today"
|
||||
@ -480,6 +480,16 @@ export class HAFullCalendar extends LitElement {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.buttons {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.buttons > * {
|
||||
margin-bottom: 5px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.today {
|
||||
margin-right: 20px;
|
||||
margin-inline-end: 20px;
|
||||
|
@ -69,8 +69,6 @@ export class HuiCalendarCard extends LitElement implements LovelaceCard {
|
||||
|
||||
@state() private _narrow = false;
|
||||
|
||||
@state() private _veryNarrow = false;
|
||||
|
||||
@state() private _error?: string = undefined;
|
||||
|
||||
private _startDate?: Date;
|
||||
@ -121,9 +119,11 @@ export class HuiCalendarCard extends LitElement implements LovelaceCard {
|
||||
return nothing;
|
||||
}
|
||||
|
||||
const views: FullCalendarView[] = this._veryNarrow
|
||||
? ["listWeek"]
|
||||
: ["dayGridMonth", "dayGridDay", "listWeek"];
|
||||
const views: FullCalendarView[] = [
|
||||
"dayGridMonth",
|
||||
"dayGridDay",
|
||||
"listWeek",
|
||||
];
|
||||
|
||||
return html`
|
||||
<ha-card>
|
||||
@ -206,7 +206,6 @@ export class HuiCalendarCard extends LitElement implements LovelaceCard {
|
||||
return;
|
||||
}
|
||||
this._narrow = card.offsetWidth < 870;
|
||||
this._veryNarrow = card.offsetWidth < 350;
|
||||
}
|
||||
|
||||
private async _attachObserver(): Promise<void> {
|
||||
|
Loading…
x
Reference in New Issue
Block a user