Browse Source

end of scroll

master
Pascal Gloor 5 years ago
parent
commit
bbf834d59a
1 changed files with 11 additions and 2 deletions
  1. 11
    2
      www/js/autodoc.js

+ 11
- 2
www/js/autodoc.js View File

}, },
home: { home: {
width: 4, width: 4,
curpage: 0
curpage: 0,
end: 0
} }
}; };


conf.home.curpage, conf.home.curpage,
null, null,
function(data, textStatus, jqXHR) { function(data, textStatus, jqXHR) {
// last document was loaded, stop scrolling
if (data.length < conf.home.width) {
conf.home.end = 1;
}
$.each(data, function(id, doc) { $.each(data, function(id, doc) {
var col = $(tmpl) var col = $(tmpl)
.find(".autodoc_template_home_col") .find(".autodoc_template_home_col")
} }


function page_home_scroll() { function page_home_scroll() {
// don't scroll if we've loaded the last document
if (conf.home.end) {
return;
}
if (isvisible($(".autodoc_template_home_col").last())) { if (isvisible($(".autodoc_template_home_col").last())) {
console.log("scroll to page " + conf.home.curpage);
console.log("scroll to page " + conf.home.curpage);
conf.home.curpage++; conf.home.curpage++;
document_load(); document_load();
} }

Loading…
Cancel
Save