Změny designu

closes #2 @1h
This commit is contained in:
2021-01-30 01:55:11 +01:00
parent b75b9c3ae6
commit b9c668841d
3 changed files with 42 additions and 2 deletions

View File

@@ -27,6 +27,7 @@ class Controller {
this.loadXml(videoToLoad).then(
function (v) {
this.view.drawCommentsText(v);
this.addEventListeners();
this.view.drawCommentsToVideo(v);
}.bind(this)
);
@@ -79,6 +80,26 @@ class Controller {
);
}
addEventListeners() {
let comments = document.getElementsByClassName("comment");
for (let i = 0; i < comments.length; i++) {
comments[i].addEventListener(
"mouseover",
function () {
this.view.commentHover(comments[i].firstChild);
}.bind(this)
);
comments[i].addEventListener(
"mouseout",
function () {
if (!comments[i].classList.contains("activeComment"))
this.view.commentHover(comments[i].firstChild, false);
}.bind(this)
);
}
}
async loadVideo(v) {
let video = document.getElementById("video");