Fixed listeners-issue on embedded player

This commit is contained in:
Kasper Rynning-Tønnesen
2018-04-27 12:56:47 +02:00
parent 6b926ca92e
commit e8208c32ea
3 changed files with 25 additions and 16 deletions

View File

@@ -180,7 +180,7 @@
} }
#playlist{ #playlist{
background-color:grey; /*background-color:grey;*/
height:100vh; height:100vh;
width:50vw; width:50vw;
overflow:hidden; overflow:hidden;
@@ -207,10 +207,11 @@
#controls #controls
{ {
background: inherit;
position: relative; position: relative;
opacity:0; opacity:0;
height:32px; height:32px;
background-color:grey;
width:50vw; width:50vw;
color:white; color:white;
margin-top:-5px; margin-top:-5px;
@@ -429,6 +430,10 @@ html {
overflow: hidden; overflow: hidden;
} }
#pageButtons {
background: inherit;
}
#pageButtons, #pageButtons a{ #pageButtons, #pageButtons a{
color:white !important; color:white !important;
} }
@@ -496,6 +501,7 @@ padding: 0 5px;
} }
*/ */
#wrapper{ #wrapper{
background: inherit;
/*height: 94%;*/ /*height: 94%;*/
} }

View File

@@ -118,9 +118,11 @@ window.addEventListener("DOMContentLoaded", function() {
Player.loadPlayer(); Player.loadPlayer();
Playercontrols.initSlider(); Playercontrols.initSlider();
document.getElementById("playpause").addEventListener("click", Playercontrols.play_pause);
window.setVolume = setVolume; window.setVolume = setVolume;
Helper.css("#controls", "background-color", color); //Helper.css("#controls", "background-color", color);
Helper.css("#wrapper", "background-color", color);
document.querySelector("body").style.backgroundColor = color;
if(hash.indexOf("controll") > -1) { if(hash.indexOf("controll") > -1) {
Hostcontroller.change_enabled(true); Hostcontroller.change_enabled(true);
} else { } else {
@@ -325,21 +327,23 @@ function emit() {
} }
} }
function handleEvent(e, target, tried, type) { function handleEvent(e, target, tried, type) {
if(dynamicListeners[type] && dynamicListeners[type]["#" + target.id]) { for(var y = 0; y < e.path.length; y++) {
dynamicListeners[type]["#" + target.id].call(target); var target = e.path[y];
return; if(dynamicListeners[type] && dynamicListeners[type]["#" + target.id]) {
} else { dynamicListeners[type]["#" + target.id].call(target);
for(var i = 0; i < target.classList.length; i++) { return;
if(dynamicListeners[type] && dynamicListeners[type]["." + target.classList[i]]) { } else {
dynamicListeners[type]["." + target.classList[i]].call(target); if(target.classList == undefined) return;
return; for(var i = 0; i < target.classList.length; i++) {
if(dynamicListeners[type] && dynamicListeners[type]["." + target.classList[i]]) {
dynamicListeners[type]["." + target.classList[i]].call(target);
return;
}
} }
} }
} }
if(!tried) {
handleEvent(e, e.target.parentElement, true, type);
}
} }
function addListener(type, element, callback) { function addListener(type, element, callback) {

View File

@@ -667,7 +667,6 @@ function handleEvent(e, target, tried, type) {
} }
} }
} }
} }
function addListener(type, element, callback) { function addListener(type, element, callback) {