Remove "sticky sidebar" JS in favor of CSS media queries

This commit is contained in:
iBug
2024-05-05 18:23:01 +08:00
parent 4364fb73f5
commit c76813f6f5
5 changed files with 5 additions and 24 deletions

View File

@ -6,27 +6,6 @@ $(function() {
// FitVids init
$("#main").fitVids();
// Sticky sidebar
var stickySideBar = function() {
var show =
$(".author__urls-wrapper").find("button").length === 0
? $(window).width() > 1024 // width should match $large Sass variable
: !$(".author__urls-wrapper").find("button").is(":visible");
if (show) {
// fix
$(".sidebar").addClass("sticky");
} else {
// unfix
$(".sidebar").removeClass("sticky");
}
};
stickySideBar();
$(window).resize(function() {
stickySideBar();
});
// Follow menu drop down
$(".author__urls-wrapper").find("button").on("click", function() {
$(".author__urls").toggleClass("is--visible");

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long