Skip to content

Commit 02973e0

Browse files
committed
Closes #1975 RM stickyfill in favor of native browser support
1 parent a683245 commit 02973e0

File tree

4 files changed

+2
-45
lines changed

4 files changed

+2
-45
lines changed

assets/js/_main.js

-35
Original file line numberDiff line numberDiff line change
@@ -24,41 +24,6 @@ $(document).ready(function(){
2424
// FitVids init
2525
fitvids();
2626

27-
// init sticky sidebar
28-
$(".sticky").Stickyfill();
29-
30-
var stickySideBar = function(){
31-
const MINIMUM_WIDTH = 1024;
32-
33-
// Adjust if the follow button is shown based upon screen size
34-
var width = $(window).width();
35-
var show = $(".author__urls-wrapper button").length === 0 ? width > MINIMUM_WIDTH : !$(".author__urls-wrapper button").is(":visible");
36-
37-
// Don't show the follow button if there is no content for it
38-
var count = $('.author__urls.social-icons li').length - $('li[class="author__desktop"]').length;
39-
if (width <= MINIMUM_WIDTH && count === 0) {
40-
$(".author__urls-wrapper button").hide();
41-
show = false;
42-
}
43-
44-
if (show) {
45-
// fix
46-
Stickyfill.rebuild();
47-
Stickyfill.init();
48-
$(".author__urls").show();
49-
} else {
50-
// unfix
51-
Stickyfill.stop();
52-
$(".author__urls").hide();
53-
}
54-
};
55-
56-
stickySideBar();
57-
58-
$(window).resize(function(){
59-
stickySideBar();
60-
});
61-
6227
// Follow menu drop down
6328
$(".author__urls-wrapper button").on("click", function() {
6429
$(".author__urls").fadeToggle("fast", function() {});

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.

assets/js/plugins/stickyfill.min.js

-8
This file was deleted.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"uglify-js": "^3.17.4"
3535
},
3636
"scripts": {
37-
"uglify": "uglifyjs node_modules/jquery/dist/jquery.min.js node_modules/fitvids/dist/fitvids.min.js node_modules/magnific-popup/dist/jquery.magnific-popup.min.js node_modules/jquery-smooth-scroll/jquery.smooth-scroll.min.js assets/js/plugins/jquery.greedy-navigation.js assets/js/plugins/stickyfill.min.js assets/js/_main.js -c -m -o assets/js/main.min.js",
37+
"uglify": "uglifyjs node_modules/jquery/dist/jquery.min.js node_modules/fitvids/dist/fitvids.min.js node_modules/magnific-popup/dist/jquery.magnific-popup.min.js node_modules/jquery-smooth-scroll/jquery.smooth-scroll.min.js assets/js/plugins/jquery.greedy-navigation.js assets/js/_main.js -c -m -o assets/js/main.min.js",
3838
"watch:js": "onchange \"assets/js/**/*.js\" -e \"assets/js/main.min.js\" -- npm run build:js",
3939
"build:js": "npm run uglify"
4040
}

0 commit comments

Comments
 (0)