Add: Minimize when clicking in details div

pull/16/head
Juraj Nyíri 4 years ago
parent 3cc4b2d2a5
commit 04773125fc

@ -19986,10 +19986,15 @@ class PlexMeetsHomeAssistant extends HTMLElement {
this.detailElem = document.createElement('div'); this.detailElem = document.createElement('div');
this.detailElem.className = 'detail'; this.detailElem.className = 'detail';
this.detailElem.innerHTML = this.detailElem.innerHTML =
"<h1></h1><h2></h2><span class='metaInfo'></span><span class='detailDesc'></span><div class='clear'></div><button class='detailPlayAction'>Fullscreen Trailer</button>"; "<h1></h1><h2></h2><span class='metaInfo'></span><span class='detailDesc'></span><div class='clear'></div><button class='detailPlayAction'>Fullscreen Trailer</button><div class='clear'></div>";
this.detailElem.addEventListener('click', () => {
this.hideBackground();
this.minimizeAll();
});
this.content.appendChild(this.detailElem); this.content.appendChild(this.detailElem);
const fullscreenTrailer = this.getElementsByClassName('detailPlayAction')[0]; const fullscreenTrailer = this.getElementsByClassName('detailPlayAction')[0];
fullscreenTrailer.addEventListener('click', () => { fullscreenTrailer.addEventListener('click', event => {
event.stopPropagation();
if (this.videoElem) { if (this.videoElem) {
const videoPlayer = this.getElementsByClassName('videoPlayer')[0]; const videoPlayer = this.getElementsByClassName('videoPlayer')[0];
const video = videoPlayer.children[0]; const video = videoPlayer.children[0];

@ -327,12 +327,18 @@ class PlexMeetsHomeAssistant extends HTMLElement {
this.detailElem = document.createElement('div'); this.detailElem = document.createElement('div');
this.detailElem.className = 'detail'; this.detailElem.className = 'detail';
this.detailElem.innerHTML = this.detailElem.innerHTML =
"<h1></h1><h2></h2><span class='metaInfo'></span><span class='detailDesc'></span><div class='clear'></div><button class='detailPlayAction'>Fullscreen Trailer</button>"; "<h1></h1><h2></h2><span class='metaInfo'></span><span class='detailDesc'></span><div class='clear'></div><button class='detailPlayAction'>Fullscreen Trailer</button><div class='clear'></div>";
this.detailElem.addEventListener('click', () => {
this.hideBackground();
this.minimizeAll();
});
this.content.appendChild(this.detailElem); this.content.appendChild(this.detailElem);
const fullscreenTrailer = this.getElementsByClassName('detailPlayAction')[0] as HTMLElement; const fullscreenTrailer = this.getElementsByClassName('detailPlayAction')[0] as HTMLElement;
fullscreenTrailer.addEventListener('click', () => { fullscreenTrailer.addEventListener('click', event => {
event.stopPropagation();
if (this.videoElem) { if (this.videoElem) {
const videoPlayer = this.getElementsByClassName('videoPlayer')[0] as HTMLElement; const videoPlayer = this.getElementsByClassName('videoPlayer')[0] as HTMLElement;
const video = videoPlayer.children[0] as any; const video = videoPlayer.children[0] as any;

Loading…
Cancel
Save