Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rjzupkoii committed Mar 18, 2024
1 parent 4a9aa07 commit 2ae25fa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
14 changes: 13 additions & 1 deletion assets/js/_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,19 @@ $(document).ready(function(){
$(".sticky").Stickyfill();

var stickySideBar = function(){
var show = $(".author__urls-wrapper button").length === 0 ? $(window).width() > 1024 : !$(".author__urls-wrapper button").is(":visible");
const MINIMUM_WIDTH = 1024;

// Adjust if the follow button is shown based upon screen size
var width = $(window).width();
var show = $(".author__urls-wrapper button").length === 0 ? width > MINIMUM_WIDTH : !$(".author__urls-wrapper button").is(":visible");

// Don't show the follow button if there is no content for it
var count = $('.author__urls.social-icons li').length - $('li[class="author__desktop"]').length;
if (width <= MINIMUM_WIDTH && count === 0) {
$(".author__urls-wrapper button").hide();
show = false;
}

if (show) {
// fix
Stickyfill.rebuild();
Expand Down
2 changes: 1 addition & 1 deletion assets/js/main.min.js

Large diffs are not rendered by default.

0 comments on commit 2ae25fa

Please sign in to comment.