Snippets - fixed after bootstrap
Project - restyled show page, removed info page Repository - restyled show page, added download option Tags - added download options
This commit is contained in:
parent
3d77183c16
commit
4d89322d67
37 changed files with 298 additions and 333 deletions
44
app/assets/javascripts/pager.js
Normal file
44
app/assets/javascripts/pager.js
Normal file
|
@ -0,0 +1,44 @@
|
|||
var Pager = {
|
||||
ref:null,
|
||||
limit:0,
|
||||
offset:0,
|
||||
|
||||
init:
|
||||
function(ref, limit) {
|
||||
this.ref=ref;
|
||||
this.limit=limit;
|
||||
this.offset=limit;
|
||||
this.initLoadMore();
|
||||
$('.loading').show();
|
||||
},
|
||||
|
||||
getOld:
|
||||
function() {
|
||||
$('.loading').show();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: location.href,
|
||||
data: "limit=" + this.limit + "&offset=" + this.offset,
|
||||
complete: function(){ $('.loading').hide()},
|
||||
dataType: "script"});
|
||||
},
|
||||
|
||||
append:
|
||||
function(count, html) {
|
||||
$(".content_list").append(html);
|
||||
if(count > 0) {
|
||||
this.offset += count;
|
||||
this.initLoadMore();
|
||||
}
|
||||
},
|
||||
|
||||
initLoadMore:
|
||||
function() {
|
||||
$(window).bind('scroll', function(){
|
||||
if($(window).scrollTop() == $(document).height() - $(window).height()){
|
||||
$(window).unbind('scroll');
|
||||
Pager.getOld();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue