Merge branch '0615-layoutrefactor'

This commit is contained in:
Ginger Wong
2020-06-16 02:16:21 -07:00
6 changed files with 295 additions and 241 deletions

View File

@@ -27,8 +27,6 @@ function setupApp() {
// style hackings
window.VIDEOJS_NO_DYNAMIC_STYLE = true;
setVHvar();
// init messaging interactions
var appMessagingMisc = new Messaging();

View File

@@ -81,6 +81,8 @@ class Messaging {
this.formMessageInput.addEventListener("focus", this.handleKeyboardAppear.bind(this));
this.formMessageInput.addEventListener("blur", this.handleKeyboardOut.bind(this));
} else {
this.tagAppContainer.classList.add("desktop");
}
}
@@ -99,12 +101,18 @@ class Messaging {
this.imgUsernameAvatar.src = this.avatarSource + username;
}
displayChat() {
this.tagAppContainer.className = this.chatDisplayed ? "flex" : "flex no-chat";
if (this.chatDisplayed) {
this.tagAppContainer.classList.add("chat");
this.tagAppContainer.classList.remove("no-chat");
} else {
this.tagAppContainer.classList.add("no-chat");
this.tagAppContainer.classList.remove("chat");
}
}
handleOrientationChange() {
console.log("====orientation change 123", event, window.screen.orientation, window.orientation, window.matchMedia("(orientation: landscape)"))
mobileVHhack();
// mobileVHhack();
// if small landscape, hide chat
// var mql = window.matchMedia("(orientation: landscape)"); // what it _was_

View File

@@ -23,9 +23,9 @@ function clearLocalStorage(key) {
}
function jumpToBottom(id) {
const div = document.querySelector(id);
const div = id ? document.querySelector(id) : document.body;
div.scrollTo({
top: div.scrollHeight,// - div.clientHeight,
top: div.scrollHeight,
left: 0,
behavior: 'smooth'
});