From 04773125fcc04e7367ef7417b3a24e15a5220935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20Nyi=CC=81ri?= Date: Sun, 6 Jun 2021 17:49:44 +0200 Subject: [PATCH] Add: Minimize when clicking in details div --- dist/plex-meets-homeassistant.js | 9 +++++++-- src/plex-meets-homeassistant.ts | 10 ++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/dist/plex-meets-homeassistant.js b/dist/plex-meets-homeassistant.js index 0633b15..66a5a0f 100644 --- a/dist/plex-meets-homeassistant.js +++ b/dist/plex-meets-homeassistant.js @@ -19986,10 +19986,15 @@ class PlexMeetsHomeAssistant extends HTMLElement { this.detailElem = document.createElement('div'); this.detailElem.className = 'detail'; this.detailElem.innerHTML = - "

"; + "

"; + this.detailElem.addEventListener('click', () => { + this.hideBackground(); + this.minimizeAll(); + }); this.content.appendChild(this.detailElem); const fullscreenTrailer = this.getElementsByClassName('detailPlayAction')[0]; - fullscreenTrailer.addEventListener('click', () => { + fullscreenTrailer.addEventListener('click', event => { + event.stopPropagation(); if (this.videoElem) { const videoPlayer = this.getElementsByClassName('videoPlayer')[0]; const video = videoPlayer.children[0]; diff --git a/src/plex-meets-homeassistant.ts b/src/plex-meets-homeassistant.ts index e4583cb..7750d4f 100644 --- a/src/plex-meets-homeassistant.ts +++ b/src/plex-meets-homeassistant.ts @@ -327,12 +327,18 @@ class PlexMeetsHomeAssistant extends HTMLElement { this.detailElem = document.createElement('div'); this.detailElem.className = 'detail'; this.detailElem.innerHTML = - "

"; + "

"; + + this.detailElem.addEventListener('click', () => { + this.hideBackground(); + this.minimizeAll(); + }); this.content.appendChild(this.detailElem); const fullscreenTrailer = this.getElementsByClassName('detailPlayAction')[0] as HTMLElement; - fullscreenTrailer.addEventListener('click', () => { + fullscreenTrailer.addEventListener('click', event => { + event.stopPropagation(); if (this.videoElem) { const videoPlayer = this.getElementsByClassName('videoPlayer')[0] as HTMLElement; const video = videoPlayer.children[0] as any;