Skip to content

Commit

Permalink
Added infinite scroll, removed unused functions, updated font awesome
Browse files Browse the repository at this point in the history
  • Loading branch information
max-holland committed May 21, 2014
1 parent 3ce8295 commit 7907ca2
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 4 deletions.
2 changes: 1 addition & 1 deletion assets/css/screen.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/scripts/infinitescroll.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/scripts/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

61 changes: 61 additions & 0 deletions assets/scripts/manual-scroll.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
--------------------------------
Infinite Scroll Behavior
Manual / Twitter-style
--------------------------------
+ https://github.com/paulirish/infinitescroll/
+ version 2.0b2.110617
+ Copyright 2011 Paul Irish & Luke Shumard
+ Licensed under the MIT license
+ Documentation: http://infinite-scroll.com/
*/

(function($, undefined) {
$.extend($.infinitescroll.prototype,{

_setup_twitter: function infscr_setup_twitter () {
var opts = this.options,
instance = this;

// Bind nextSelector link to retrieve
$(opts.nextSelector).click(function(e) {
if (e.which == 1 && !e.metaKey && !e.shiftKey) {
e.preventDefault();
instance.retrieve();
}
});

// Define loadingStart to never hide pager
instance.options.loading.start = function (opts) {
opts.loading.msg
.appendTo(opts.loading.selector)
.show(opts.loading.speed, function () {
instance.beginAjax(opts);
});
}
},
_showdonemsg_twitter: function infscr_showdonemsg_twitter () {
var opts = this.options,
instance = this;

//Do all the usual stuff
opts.loading.msg
.find('img')
.hide()
.parent()
.find('div').html(opts.loading.finishedMsg).animate({ opacity: 1 }, 2000, function () {
$(this).parent().fadeOut('normal');
});

//And also hide the navSelector
$(opts.navSelector).fadeOut('normal');

// user provided callback when done
opts.errorCallback.call($(opts.contentSelector)[0],'done');

}

});
})(jQuery);
6 changes: 5 additions & 1 deletion default.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
{{> google-authorship}}

{{! Styles'n'Scripts }}
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<link href="//netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="{{asset "css/screen.css"}}" />
<style>
/* Gulp keeps removing webkit/moz support */
Expand Down Expand Up @@ -86,6 +86,10 @@

<script src="{{asset "scripts/jquery.magnific-popup.min.js"}}"></script>

<script src="{{asset "scripts/infinitescroll.js"}}"></script>

<script src="{{asset "scripts/manual-scroll.js"}}"></script>

<script src="{{asset "scripts/main.js"}}"></script>

{{> google-analytics}}
Expand Down
9 changes: 8 additions & 1 deletion index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@
{{/foreach}}

{{!! After all the posts, we have the previous/next pagination links }}
{{pagination}}

</div>


</section>
<section>
<div class="grid-container grid-720">
{{pagination}}
</div>
</section>

Expand Down

0 comments on commit 7907ca2

Please sign in to comment.