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 #752
  • Loading branch information
mmistakes committed Jan 5, 2017
1 parent 88933c4 commit 55843c5
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 88 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ 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
28 changes: 0 additions & 28 deletions assets/js/_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,7 @@ $(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

$(".author__urls-wrapper button").on("click", function() {
$(".author__urls").fadeToggle("fast", function() {});
$(".author__urls-wrapper button").toggleClass("open");
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.

3 changes: 1 addition & 2 deletions docs/_docs/17-javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ minimal mistakes
| | | ├── jquery.fitvids.js # fluid width video embeds
| | | ├── jquery.greedy-navigation.js # priority plus navigation
| | | ├── jquery.magnific-popup.js # responsive lightbox
| | | ├── jquery.smooth-scroll.min.js # make same-page links scroll smoothly
| | | └── stickyfill.min.js # `position: sticky` polyfill
| | | └── jquery.smooth-scroll.min.js # make same-page links scroll smoothly
| | ├── vendor
| | | └── jquery
| | | └── jquery-1.12.1.min.js
Expand Down
3 changes: 1 addition & 2 deletions docs/_pages/about.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ layouts_gallery:
- url: /assets/images/mm-layout-archive.png
image_path: /assets/images/mm-layout-archive.png
alt: "archive layout example"
modified: 2016-11-03T11:55:22-04:00
modified: 2017-01-05T11:46:07-05:00
---

Minimal Mistakes is a flexible two-column Jekyll theme. Perfect for hosting your personal site, blog, or portfolio on GitHub or self-hosting on your own server. As the name implies --- styling is purposely minimalistic to be enhanced and customized by you :smile:.
Expand Down Expand Up @@ -75,7 +75,6 @@ For even more demo pages check the [posts archive][year-archive].
- [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
28 changes: 0 additions & 28 deletions docs/assets/js/_main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,7 @@ $(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

$(".author__urls-wrapper button").on("click", function() {
$(".author__urls").fadeToggle("fast", function() {});
$(".author__urls-wrapper button").toggleClass("open");
Expand Down
9 changes: 4 additions & 5 deletions docs/assets/js/main.min.js

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions docs/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 @@ -26,7 +26,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 55843c5

Please sign in to comment.