diff --git a/static/js/ui.js b/static/js/ui.js
index 2240abc8df..ba0acbc393 100644
--- a/static/js/ui.js
+++ b/static/js/ui.js
@@ -352,6 +352,16 @@ function set_user_list_heights(res, usable_height, user_presences, group_pms) {
res.group_pms_max_height = blocks[1].max_height;
}
+function scrollbarWidth() {
+ $('body').prepend('
');
+
+ var scrollwidth = $("#outertest").outerWidth() - $("#innertest").outerWidth();
+
+ $("#outertest").remove();
+
+ return scrollwidth;
+}
+
function get_new_heights() {
var res = {};
var viewport_height = viewport.height();
@@ -1875,6 +1885,31 @@ $(function () {
}
});
+// Workaround for browsers with fixed scrollbars
+$(function () {
+
+
+ var sbWidth = scrollbarWidth();
+
+ if (sbWidth > 0) {
+
+ $(".header").css("left", "-" + sbWidth + "px");
+ $(".header-main").css("left", sbWidth + "px");
+ $(".header-main").css("max-width", (1400 + sbWidth) + "px");
+ $(".header-main .column-middle").css("margin-right", (250 + sbWidth) + "px");
+
+ $(".fixed-app").css("left", "-" + sbWidth + "px");
+ $(".fixed-app .app-main").css("max-width", (1400 + sbWidth) + "px");
+ $(".fixed-app .column-middle").css("margin-left", (250 + sbWidth) + "px");
+
+ $("#compose").css("left", "-" + sbWidth + "px");
+ $(".compose-content").css({"left": sbWidth + "px",
+ "margin-right": (250 + sbWidth) + "px"});
+ $("#compose-container").css("max-width", (1400 + sbWidth) + "px");
+
+ }
+
+});
return exports;
}());
diff --git a/templates/zerver/index.html b/templates/zerver/index.html
index d037e4a2e6..d07f0a043a 100644
--- a/templates/zerver/index.html
+++ b/templates/zerver/index.html
@@ -98,22 +98,6 @@ var page_params = {{ page_params }};
-
-
{% include "zerver/home.html" %}