Browse Source

scroll

master
Pascal Gloor 5 years ago
parent
commit
cf588ffbaa
1 changed files with 15 additions and 9 deletions
  1. 15
    9
      www/js/autodoc.js

+ 15
- 9
www/js/autodoc.js View File

home: "page_load_home()" home: "page_load_home()"
}, },
home: { home: {
width: 4
width: 4,
curpage: 0
} }
}; };


$(document).ready(function() { $(document).ready(function() {
change_page(); change_page();
$.scroll(function() { page_home_scroll();
}); });


$(window).bind("hashchange", function() { $(window).bind("hashchange", function() {
} }


function page_load_home() { function page_load_home() {
document_load(0);
document_load();
} }


function document_load(page) {
if (!page || page == 0) {
function document_load() {
if (conf.home.curpage == 0) {
$("#autodoc_home_body").html(""); $("#autodoc_home_body").html("");
page = 0;
} }


var tmpl = $("#autodoc_template_home"); var tmpl = $("#autodoc_template_home");
"/documents?pageSize=" + "/documents?pageSize=" +
conf.home.width + conf.home.width +
"&pageIndex=" + "&pageIndex=" +
page,
conf.home.curpage,
null, null,
function(data, textStatus, jqXHR) { function(data, textStatus, jqXHR) {
$.each(data, function(id, doc) { $.each(data, function(id, doc) {
}); });
$("#autodoc_home_body").append(row); $("#autodoc_home_body").append(row);
// continue to load until out of browser. // continue to load until out of browser.
if (isvisible($(".autodoc_template_home_col").last())) {
document_load(page + 1);
}
page_home_scroll();
} }
); );
} }

function page_home_scroll() {
if (isvisible($(".autodoc_template_home_col").last())) {
conf.home.curpage++;
document_load();
}
}

Loading…
Cancel
Save