Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion src/panels/lovelace/editor/card-editor/hui-dialog-edit-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export class HuiDialogEditCard extends LitElement
implements HassDialog<EditCardDialogParams> {
@property({ attribute: false }) public hass!: HomeAssistant;

@property({ type: Boolean, reflect: true }) public large = false;

@internalProperty() private _params?: EditCardDialogParams;

@internalProperty() private _cardConfig?: LovelaceCardConfig;
Expand Down Expand Up @@ -82,6 +84,7 @@ export class HuiDialogEditCard extends LitElement
this._viewConfig = params.lovelaceConfig.views[view];
this._cardConfig =
card !== undefined ? this._viewConfig.cards![card] : params.cardConfig;
this.large = false;
if (this._cardConfig && !Object.isFrozen(this._cardConfig)) {
this._cardConfig = deepFreeze(this._cardConfig);
}
Expand Down Expand Up @@ -162,7 +165,7 @@ export class HuiDialogEditCard extends LitElement
>
<div slot="heading">
<ha-header-bar>
<div slot="title">${heading}</div>
<div slot="title" @click=${this._enlarge}>${heading}</div>
${this._documentationURL !== undefined
? html`
<a
Expand Down Expand Up @@ -254,6 +257,10 @@ export class HuiDialogEditCard extends LitElement
`;
}

private _enlarge() {
this.large = !this.large;
}

private _ignoreKeydown(ev: KeyboardEvent) {
ev.stopPropagation();
}
Expand Down Expand Up @@ -374,6 +381,15 @@ export class HuiDialogEditCard extends LitElement
--dialog-z-index: 5;
}

@media all and (min-width: 451px) and (min-height: 501px) {
ha-dialog {
--mdc-dialog-max-width: 90vw;
}
:host([large]) .content {
width: calc(90vw - 48px);
}
}

ha-header-bar {
--mdc-theme-on-primary: var(--primary-text-color);
--mdc-theme-primary: var(--mdc-theme-surface);
Expand Down