Convert manual className editing to addClass and removeClass
This commit is contained in:
parent
240745a404
commit
4480477e49
1 changed files with 5 additions and 1 deletions
|
@ -132,7 +132,11 @@ function isScrolledToBottom() {
|
||||||
return scrolledTo >= el.scrollHeight;
|
return scrolledTo >= el.scrollHeight;
|
||||||
}
|
}
|
||||||
function checkScrolledToBottom() {
|
function checkScrolledToBottom() {
|
||||||
byId("channel_contents_wrapper").className = isScrolledToBottom() ? "" : "not-at-bottom";
|
if (isScrolledToBottom()) {
|
||||||
|
removeClass(byId("channel_contents_wrapper"), "not-at-bottom");
|
||||||
|
} else {
|
||||||
|
addClass(byId("channel_contents_wrapper"), "not-at-bottom");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
byId("channel_contents_wrapper").addEventListener("scroll", checkScrolledToBottom);
|
byId("channel_contents_wrapper").addEventListener("scroll", checkScrolledToBottom);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue