Skip to content

Commit d040cf5

Browse files
rjzupkoiiaaronWool
authored andcommitted
1 parent c576e43 commit d040cf5

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

assets/js/_main.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,19 @@ $(document).ready(function(){
2727
$(".sticky").Stickyfill();
2828

2929
var stickySideBar = function(){
30-
var show = $(".author__urls-wrapper button").length === 0 ? $(window).width() > 1024 : !$(".author__urls-wrapper button").is(":visible");
30+
const MINIMUM_WIDTH = 1024;
31+
32+
// Adjust if the follow button is shown based upon screen size
33+
var width = $(window).width();
34+
var show = $(".author__urls-wrapper button").length === 0 ? width > MINIMUM_WIDTH : !$(".author__urls-wrapper button").is(":visible");
35+
36+
// Don't show the follow button if there is no content for it
37+
var count = $('.author__urls.social-icons li').length - $('li[class="author__desktop"]').length;
38+
if (width <= MINIMUM_WIDTH && count === 0) {
39+
$(".author__urls-wrapper button").hide();
40+
show = false;
41+
}
42+
3143
if (show) {
3244
// fix
3345
Stickyfill.rebuild();

assets/js/main.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)