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

View File

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

View File

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