mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +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>
|
</ha-icon-button-next>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="controls">
|
<div class="controls buttons">
|
||||||
<mwc-button
|
<mwc-button
|
||||||
outlined
|
outlined
|
||||||
class="today"
|
class="today"
|
||||||
@ -480,6 +480,16 @@ export class HAFullCalendar extends LitElement {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.buttons {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.buttons > * {
|
||||||
|
margin-bottom: 5px;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
.today {
|
.today {
|
||||||
margin-right: 20px;
|
margin-right: 20px;
|
||||||
margin-inline-end: 20px;
|
margin-inline-end: 20px;
|
||||||
|
@ -69,8 +69,6 @@ export class HuiCalendarCard extends LitElement implements LovelaceCard {
|
|||||||
|
|
||||||
@state() private _narrow = false;
|
@state() private _narrow = false;
|
||||||
|
|
||||||
@state() private _veryNarrow = false;
|
|
||||||
|
|
||||||
@state() private _error?: string = undefined;
|
@state() private _error?: string = undefined;
|
||||||
|
|
||||||
private _startDate?: Date;
|
private _startDate?: Date;
|
||||||
@ -121,9 +119,11 @@ export class HuiCalendarCard extends LitElement implements LovelaceCard {
|
|||||||
return nothing;
|
return nothing;
|
||||||
}
|
}
|
||||||
|
|
||||||
const views: FullCalendarView[] = this._veryNarrow
|
const views: FullCalendarView[] = [
|
||||||
? ["listWeek"]
|
"dayGridMonth",
|
||||||
: ["dayGridMonth", "dayGridDay", "listWeek"];
|
"dayGridDay",
|
||||||
|
"listWeek",
|
||||||
|
];
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<ha-card>
|
<ha-card>
|
||||||
@ -206,7 +206,6 @@ export class HuiCalendarCard extends LitElement implements LovelaceCard {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this._narrow = card.offsetWidth < 870;
|
this._narrow = card.offsetWidth < 870;
|
||||||
this._veryNarrow = card.offsetWidth < 350;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _attachObserver(): Promise<void> {
|
private async _attachObserver(): Promise<void> {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user