commento.js: compute mobileView only once

This commit is contained in:
Adhityaa Chandrasekar 2019-02-20 10:55:51 -05:00
parent 352c93bf88
commit f4489c9921

View File

@ -85,6 +85,7 @@
var popupBoxType = "login";
var oauthButtonsShown = false;
var selfHex = undefined;
var mobileView = null;
function $(id) {
@ -661,7 +662,6 @@
var cards = create("div");
cur.forEach(function(comment) {
var mobileView = root.getBoundingClientRect()["width"] < 450;
var commenter = commenters[comment.commenterHex];
var avatar;
var card = create("div");
@ -1619,6 +1619,10 @@
return;
}
if (mobileView === null) {
mobileView = root.getBoundingClientRect()["width"] < 450;
}
classAdd(root, "root");
loginBoxCreate();