Merge pull request #673 from dermotduffy/firefox-image-aspect-ratio

Allow the image view to trigger a card resize
This commit is contained in:
Dermot Duffy
2022-06-11 16:31:14 -07:00
committed by GitHub
3 changed files with 10 additions and 9 deletions
+5 -5
View File
@@ -658,7 +658,7 @@ export class FrigateCard extends LitElement {
try {
entityList = await getAllEntities(this._hass);
} catch (e) {
console.error(e, (e as Error).stack);
console.error(e);
}
const cameras: Map<string, CameraConfig> = new Map();
@@ -674,7 +674,7 @@ export class FrigateCard extends LitElement {
try {
entity = await getExtendedEntity(this._hass, config.camera_entity, cache);
} catch (e) {
console.error(e, (e as Error).stack);
console.error(e);
}
}
@@ -704,7 +704,7 @@ export class FrigateCard extends LitElement {
cache,
);
} catch (e) {
console.error(e, (e as Error).stack);
console.error(e);
}
if (config.triggers.motion) {
@@ -1167,7 +1167,7 @@ export class FrigateCard extends LitElement {
try {
response = await homeAssistantSignPath(this._hass, path);
} catch (e) {
console.error(e, (e as Error).stack);
console.error(e);
}
if (!response) {
@@ -1608,7 +1608,7 @@ export class FrigateCard extends LitElement {
(screenfull.isEnabled && screenfull.isFullscreen) ||
aspectRatioMode == 'unconstrained' ||
(aspectRatioMode == 'dynamic' &&
(this._view?.isMediaView() || this._view?.is('timeline'))) ||
(this._view?.isAnyMediaView() || this._view?.is('timeline'))) ||
this._message != null
);
}
+1 -1
View File
@@ -108,7 +108,7 @@ export class FrigateCardElementsCore extends LitElement {
try {
element.setConfig(config);
} catch (e) {
console.error(e, (e as Error).stack);
console.error(e);
throw new FrigateCardError(localize('error.invalid_elements_config'));
}
return element;
+4 -3
View File
@@ -92,10 +92,11 @@ export class View {
}
/**
* Determine if a view is of a piece of media (i.e. not the gallery).
* Determine if a view is of a piece of media (including the media viewer,
* live view, image view -- anything that can create a MediaShowInfo event).
*/
public isMediaView(): boolean {
return this.isViewerView() || this.is('live');
public isAnyMediaView(): boolean {
return this.isViewerView() || this.is('live') || this.is('image');
}
/**