Skip to content

Commit

Permalink
Remove position: sticky JavaScript polyfill
Browse files Browse the repository at this point in the history
- Fallback to default positioning for browser that don't support it IE, Chrome < 56, etc.
- Issue mmistakes#752
  • Loading branch information
RobinYu committed Feb 13, 2017
1 parent acc97af commit 31d5cfb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 41 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ To test the theme, run `bundle exec rake preview` and open your browser at `http
- [FitVids.JS](http://fitvidsjs.com/)
- Greedy Navigation - [lukejacksonn](http://codepen.io/lukejacksonn/pen/PwmwWV)
- [jQuery Smooth Scroll](https://github.com/kswedberg/jquery-smooth-scroll)
- [Stickyfill](https://github.com/wilddeer/stickyfill)


---

Expand Down
26 changes: 0 additions & 26 deletions assets/js/_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,32 +25,6 @@ $(document).ready(function(){
// FitVids init
$("#main").fitVids();

// init sticky sidebar
$(".sticky").Stickyfill();

var stickySideBar = function(){
var show = $(".author__urls-wrapper button").length === 0 ? $(window).width() > 1024 : !$(".author__urls-wrapper button").is(":visible");
// console.log("has button: " + $(".author__urls-wrapper button").length === 0);
// console.log("Window Width: " + windowWidth);
// console.log("show: " + show);
//old code was if($(window).width() > 1024)
if (show) {
// fix
Stickyfill.rebuild();
Stickyfill.init();
$(".author__urls").show();
} else {
// unfix
Stickyfill.stop();
$(".author__urls").hide();
}
};

stickySideBar();

$(window).resize(function(){
stickySideBar();
});

// Follow menu drop down

Expand Down
9 changes: 4 additions & 5 deletions assets/js/main.min.js

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions assets/js/plugins/stickyfill.min.js

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"uglify-js": "^2.6.1"
},
"scripts": {
"uglify": "uglifyjs assets/js/vendor/jquery/jquery-1.12.4.min.js assets/js/plugins/jquery.fitvids.js assets/js/plugins/jquery.greedy-navigation.js assets/js/plugins/jquery.magnific-popup.js assets/js/plugins/jquery.smooth-scroll.min.js assets/js/plugins/stickyfill.min.js assets/js/_main.js -c -m -o assets/js/main.min.js",
"uglify": "uglifyjs assets/js/vendor/jquery/jquery-1.12.4.min.js assets/js/plugins/jquery.fitvids.js assets/js/plugins/jquery.greedy-navigation.js assets/js/plugins/jquery.magnific-popup.js assets/js/plugins/jquery.smooth-scroll.min.js assets/js/_main.js -c -m -o assets/js/main.min.js",
"watch:js": "onchange \"assets/js/**/*.js\" -e \"assets/js/main.min.js\" -- npm run build:js",
"build:js": "npm run uglify"
}
Expand Down

0 comments on commit 31d5cfb

Please # to comment.