Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions static/css/base.css
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,21 @@ span.party_header { padding-right: 20px; }
.sortHeader { text-align:middle; padding-top: 3px; }
.voteHeader { font-size: 19px; float: left; padding-right: 30px; text-align: middle; }
#voteList { margin-top: 15px; width: 100%; min-width: 1100px; }

/* voteTable.js picks 1-4 columns based on how many members are listed
(see .columns1-4 above), sized for desktop. Below the point where a
phone can't show even 2 of those columns at a readable width, force
a single column instead -- the alternative is a several-times-too-wide
layout that only reads normally after the user pinches out to see the
cut-off columns, which is what actually made the text look "tiny". */
@media (max-width: 767px) {
#voteList { min-width: 0; }
.voteTable.columns2,
.voteTable.columns3,
.voteTable.columns4 {
columns: 1;
}
}
#vote_chart_float { position: static; padding-bottom: 20px; }
#vote_chart_float .saveButton { margin-left: 5px; font-size: 18px; vertical-align: middle; cursor: pointer; color: black; }
#vote_chart_float .xlsButton { margin-left: 5px; width: 22px; vertical-align: middle; }
Expand Down
15 changes: 14 additions & 1 deletion static/js/voteCharts.js
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,20 @@ function drawWidgets(error, data, geodata, usaboundaries)
}
});

$("#vote_chart_float").delay(500).stick_in_parent();
// Only stick the vote-count chart to the viewport when its column sits
// beside the vote list (Bootstrap's md breakpoint, >=992px). Below that
// the columns stack, so a "stuck" full-width chart would end up pinned
// on top of the vote list underneath it as the page scrolls.
function updateVoteChartSticky() {
var $float = $("#vote_chart_float");
if ($(window).width() >= 992) {
if (!$float.data("sticky_kit")) { $float.stick_in_parent(); }
} else if ($float.data("sticky_kit")) {
$float.trigger("sticky_kit:detach");
}
}
$(window).on("resize", updateVoteChartSticky);
setTimeout(updateVoteChartSticky, 500);
}


Expand Down