diff --git a/frontend/js/commento.js b/frontend/js/commento.js index 1b4935d..2bd913f 100644 --- a/frontend/js/commento.js +++ b/frontend/js/commento.js @@ -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();