commento.js: compute mobileView only once
This commit is contained in:
parent
352c93bf88
commit
f4489c9921
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user