File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff 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 ( ) ;
You can’t perform that action at this time.
0 commit comments