2014-03-13 19:16:11 +01:00
|
|
|
$(function () {
|
2018-03-12 03:34:32 +01:00
|
|
|
ui.set_up_scrollbar($("#stream-filters-container"));
|
2014-03-13 19:16:11 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
|
2017-08-22 21:15:20 +02:00
|
|
|
// From https://stackoverflow.com/questions/13382516/getting-scroll-bar-width-using-javascript
|
|
|
|
function getScrollbarWidth() {
|
|
|
|
var outer = document.createElement("div");
|
|
|
|
outer.style.visibility = "hidden";
|
|
|
|
outer.style.width = "100px";
|
|
|
|
outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps
|
2014-03-13 19:16:11 +01:00
|
|
|
|
2017-08-22 21:15:20 +02:00
|
|
|
document.body.appendChild(outer);
|
2014-03-13 19:16:11 +01:00
|
|
|
|
2017-08-22 21:15:20 +02:00
|
|
|
var widthNoScroll = outer.offsetWidth;
|
|
|
|
// force scrollbars
|
|
|
|
outer.style.overflow = "scroll";
|
|
|
|
|
|
|
|
// add innerdiv
|
|
|
|
var inner = document.createElement("div");
|
|
|
|
inner.style.width = "100%";
|
|
|
|
outer.appendChild(inner);
|
|
|
|
|
|
|
|
var widthWithScroll = inner.offsetWidth;
|
|
|
|
|
|
|
|
// remove divs
|
|
|
|
outer.parentNode.removeChild(outer);
|
|
|
|
|
|
|
|
return widthNoScroll - widthWithScroll;
|
2014-03-13 19:16:11 +01:00
|
|
|
}
|
|
|
|
|
2017-08-22 21:15:20 +02:00
|
|
|
|
2014-03-13 19:16:11 +01:00
|
|
|
// Workaround for browsers with fixed scrollbars
|
|
|
|
$(function () {
|
2017-08-22 21:15:20 +02:00
|
|
|
var sbWidth = getScrollbarWidth();
|
2014-03-13 19:16:11 +01:00
|
|
|
|
|
|
|
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");
|
|
|
|
|
|
|
|
$(".column-right").css("right", sbWidth + "px");
|
|
|
|
$(".app-main .right-sidebar").css({"margin-left": (sbWidth) + "px",
|
2016-12-03 03:08:47 +01:00
|
|
|
width: (250 - sbWidth) + "px"});
|
2014-03-13 19:16:11 +01:00
|
|
|
|
|
|
|
$("#compose").css("left", "-" + sbWidth + "px");
|
2016-12-03 03:08:47 +01:00
|
|
|
$(".compose-content").css({left: sbWidth + "px",
|
2014-03-13 19:16:11 +01:00
|
|
|
"margin-right": (250 + sbWidth) + "px"});
|
|
|
|
$("#compose-container").css("max-width", (1400 + sbWidth) + "px");
|
|
|
|
|
|
|
|
$("head").append("<style> @media (max-width: 975px) { .compose-content, .header-main .column-middle { margin-right: " + (7 + sbWidth) + "px !important; } } " +
|
|
|
|
"@media (max-width: 775px) { .fixed-app .column-middle { margin-left: " + (7 + sbWidth) + "px !important; } } " +
|
|
|
|
"</style>");
|
|
|
|
}
|
|
|
|
|
|
|
|
});
|