DRY up check for feature_flags.left_side_userlist.

(imported from commit d7cbb1eee0e83ddf811451e10dd6dcd03c86ffd0)
This commit is contained in:
Steve Howell 2013-12-12 12:46:09 -05:00
parent b53513a5e7
commit 009d1ed88a
1 changed files with 24 additions and 23 deletions

View File

@ -491,30 +491,31 @@ exports.resize_page_components = function () {
var h; var h;
var sidebar; var sidebar;
if (viewport.width() < 975 && feature_flags.left_side_userlist && !narrow_window) { if (feature_flags.left_side_userlist) {
narrow_window = true; if (viewport.width() < 975 && !narrow_window) {
popovers.set_userlist_placement("left"); narrow_window = true;
sidebar = $(".bottom_sidebar").expectOne(); popovers.set_userlist_placement("left");
sidebar.append($("#user-list").expectOne()); sidebar = $(".bottom_sidebar").expectOne();
sidebar.append($("#group-pm-list").expectOne()); sidebar.append($("#user-list").expectOne());
sidebar.append($("#share-the-love").expectOne()); sidebar.append($("#group-pm-list").expectOne());
$("#user_presences").css("margin", "0px"); sidebar.append($("#share-the-love").expectOne());
$("#group-pms").css("margin", "0px"); $("#user_presences").css("margin", "0px");
$("#userlist-toggle").css("display", "none"); $("#group-pms").css("margin", "0px");
$("#invite-user-link").hide(); $("#userlist-toggle").css("display", "none");
$("#invite-user-link").hide();
}
else if (viewport.width() > 975 && narrow_window) {
narrow_window = false;
popovers.set_userlist_placement("right");
sidebar = $("#right-sidebar").expectOne();
sidebar.append($("#user-list").expectOne());
sidebar.append($("#group-pm-list").expectOne());
$("#user_presences").css("margin", '');
$("#group-pms").css("margin", '');
$("#userlist-toggle").css("display", '');
$("#invite-user-link").show();
}
} }
else if (viewport.width() > 975 && feature_flags.left_side_userlist && narrow_window) {
narrow_window = false;
popovers.set_userlist_placement("right");
sidebar = $("#right-sidebar").expectOne();
sidebar.append($("#user-list").expectOne());
sidebar.append($("#group-pm-list").expectOne());
$("#user_presences").css("margin", '');
$("#group-pms").css("margin", '');
$("#userlist-toggle").css("display", '');
$("#invite-user-link").show();
}
h = narrow_window ? left_userlist_get_new_heights() : get_new_heights(); h = narrow_window ? left_userlist_get_new_heights() : get_new_heights();