aboutsummaryrefslogtreecommitdiffstats
path: root/js/main.js
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2012-12-10 18:24:59 -0800
committerfriendica <info@friendica.com>2012-12-10 18:24:59 -0800
commitd6fde941088ebd66a231fa098eb2ea3fda9e0975 (patch)
tree4b79026f33f419f02a339b6d64fe40f3dbd30ed8 /js/main.js
parent60d21716da68028ba63e4f2aa40c35f4bfe54b0d (diff)
downloadvolse-hubzilla-d6fde941088ebd66a231fa098eb2ea3fda9e0975.tar.gz
volse-hubzilla-d6fde941088ebd66a231fa098eb2ea3fda9e0975.tar.bz2
volse-hubzilla-d6fde941088ebd66a231fa098eb2ea3fda9e0975.zip
I've already told you repeatedly how much I despise endless scroll. But will you listen? No. Here it is. Now frucking fruckoff.
Diffstat (limited to 'js/main.js')
-rw-r--r--js/main.js41
1 files changed, 40 insertions, 1 deletions
diff --git a/js/main.js b/js/main.js
index bb7e469a6..18924834d 100644
--- a/js/main.js
+++ b/js/main.js
@@ -111,7 +111,8 @@
var commentBusy = false;
var last_popup_menu = null;
var last_popup_button = null;
-
+ var scroll_next = false;
+ var next_page = 1;
var page_load = true;
$(function() {
@@ -445,6 +446,13 @@ function updateConvItems(mode,data) {
var update_url;
if(typeof buildCmd == 'function') {
+ if(scroll_next) {
+ network_page = next_page;
+ page_load = true;
+ }
+ else {
+ network_page = 1;
+ }
update_url = buildCmd();
}
else {
@@ -458,7 +466,10 @@ function updateConvItems(mode,data) {
$.get(update_url,function(data) {
var update_mode = ((page_load) ? 'replace' : 'update');
+ if(scroll_next)
+ update_mode = 'append';
page_load = false;
+ scroll_next = false;
in_progress = false;
updateConvItems(update_mode,data);
$("#profile-jot-text-loading").hide();
@@ -467,6 +478,7 @@ function updateConvItems(mode,data) {
}
+
function imgbright(node) {
$(node).removeClass("drophide").addClass("drop");
}
@@ -857,6 +869,33 @@ $("abbr.wall-item-ago-time").timeago();
//reCalcHeight();
+
+$(window).scroll(function () {
+ if(typeof buildCmd == 'function') {
+ $('#more').hide();
+ $('#no-more').hide();
+
+ if($(window).scrollTop() + $(window).height() > $(document).height() - 200) {
+ $('#more').css("top","400");
+ $('#more').show();
+ }
+
+ if($(window).scrollTop() + $(window).height() == $(document).height()) {
+ $('#more').hide();
+ $('#no-more').hide();
+ // alert('scroll');
+ next_page++;
+ scroll_next = true;
+ liveUpdate();
+
+ }
+ }
+});
+
+
+
+
+
});
function zFormError(elm,x) {