Don't display tooltips on touch only devices.

This commit is contained in:
Dermot Duffy
2022-04-10 09:04:11 -07:00
parent 4d070ac132
commit ea10d1a634
+10
View File
@@ -66,6 +66,10 @@ interface TimelineViewContext extends ViewContext {
type TimelineMediaType = 'all' | 'clips' | 'snapshots'; type TimelineMediaType = 'all' | 'clips' | 'snapshots';
const isHoverableDevice = window.matchMedia(
'(hover: hover) and (pointer: fine)'
)
/** /**
* A manager to maintain/fetch timeline events. * A manager to maintain/fetch timeline events.
*/ */
@@ -375,6 +379,12 @@ export class FrigateCardTimelineCore extends LitElement {
* @returns The tooltip as a string to render. * @returns The tooltip as a string to render.
*/ */
protected _getTooltip(source: FrigateBrowseMediaSource): string { protected _getTooltip(source: FrigateBrowseMediaSource): string {
if (!isHoverableDevice.matches) {
// Don't display tooltips on touch devices, they just get in the way of
// the drawer.
return '';
}
const thumbnailSizeAttr = this.timelineConfig const thumbnailSizeAttr = this.timelineConfig
? `thumbnail_size="${this.timelineConfig.controls.thumbnails.size}"` ? `thumbnail_size="${this.timelineConfig.controls.thumbnails.size}"`
: ''; : '';