Commits

Anonymous committed c710740

[position_divs.js] Extracted a variable for the document.body.clientWidth.

  • Participants
  • Parent commits d9797ae
  • Branches css-tweaking-for-the-about-links

Comments (0)

Files changed (1)

File src/js/position_divs.js

 function position_divs() {
-    var width = document.body.clientWidth - 780;
+    var client_w = document.body.clientWidth ;
+    var width = client_w - 780;
     document.getElementById("js-site-name").style.left   = width / 2 + 20 + "px";
     document.getElementById("js-site-slogan").style.left = width / 2 + 20 + "px";
     // Commenting out because it no longer exists.
     // document.getElementById("js-nav-global").style.right = width / 2 - 20 + "px";
     if ( document.getElementById("right-sidebar") == null ) {
-        document.getElementById("content").style.width = document.body.clientWidth - 250 + "px";
+        document.getElementById("content").style.width = client_w - 250 + "px";
     }
     else {
-        document.getElementById("content").style.width = document.body.clientWidth - 410 + "px";
+        document.getElementById("content").style.width = client_w - 410 + "px";
     }
 }