fix: Render media correctly in rtl languages (#1757)

This commit is contained in:
Dermot Duffy
2024-12-14 14:58:22 -08:00
committed by GitHub
parent dc5de02e02
commit cebd4b215b
10 changed files with 160 additions and 94 deletions
+4 -4
View File
@@ -10,7 +10,7 @@ import { createFetchThumbnailTask } from '../utils/thumbnail.js';
@customElement('frigate-card-next-previous-control')
export class FrigateCardNextPreviousControl extends LitElement {
@property({ attribute: false })
public direction?: 'next' | 'previous';
public side?: 'left' | 'right';
set controlConfig(controlConfig: NextPreviousControlConfig | undefined) {
if (controlConfig?.size) {
@@ -53,8 +53,8 @@ export class FrigateCardNextPreviousControl extends LitElement {
const classes = {
controls: true,
left: this.direction === 'previous',
right: this.direction === 'next',
left: this.side === 'left',
right: this.side === 'right',
thumbnails: !renderIcon,
icons: renderIcon,
button: renderIcon,
@@ -63,7 +63,7 @@ export class FrigateCardNextPreviousControl extends LitElement {
if (renderIcon) {
const icon =
!this.thumbnail || !this.icon || this._controlConfig.style === 'chevrons'
? this.direction === 'previous'
? this.side === 'left'
? 'mdi:chevron-left'
: 'mdi:chevron-right'
: this.icon;