From 6d05d502e3d69c0d7ac45ecc3558668f7acf5266 Mon Sep 17 00:00:00 2001 From: friendica Date: Thu, 26 Jun 2014 17:17:24 -0700 Subject: still trying to sort out the liveupdate issues. This was getting overly complicated with all the different ways we've tried to fix this issue so let's step back and simplify it a bit. --- view/js/main.js | 51 ++++++++++++++++++++------------------------------- 1 file changed, 20 insertions(+), 31 deletions(-) diff --git a/view/js/main.js b/view/js/main.js index 26cf12b47..191f24b59 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -386,8 +386,6 @@ function updateConvItems(mode,data) { - - if(mode === 'update') { prev = 'threads-begin'; @@ -546,14 +544,6 @@ function updateConvItems(mode,data) { collapseHeight(); } - - // $(".wall-item-body").each(function() { - // if(! $(this).hasClass('divmore')) { - // $(this).divgrow({ initialHeight: 400, showBrackets: false }); - // $(this).addClass('divmore'); - // } - //}); - } @@ -589,30 +579,29 @@ function updateConvItems(mode,data) { in_progress = true; var update_url; + var update_mode; -// if(typeof buildCmd == 'function') { - if(scroll_next) { - bParam_page = next_page; - page_load = true; - } - else { - bParam_page = 1; - } - update_url = buildCmd(); -// } -// else { -// page_load = false; -// var udargs = ((page_load) ? '/load' : ''); -// update_url = 'update_' + src + udargs + '&p=' + profile_uid + '&page=' + profile_page + '&msie=' + ((msie) ? 1 : 0); -// } - - if(page_load) + if(scroll_next) { + bParam_page = next_page; + page_load = true; + } + else { + bParam_page = 1; + } + + update_url = buildCmd(); + + if(page_load) { $("#page-spinner").spin('small'); + if(bParam_page == 1) + update_mode = 'replace'; + else + update_mode = 'append'; + } + else + update_mode = 'update'; $.get(update_url,function(data) { - var update_mode = ((page_load && bParam_page == 1) ? 'replace' : 'update'); - if(scroll_next) - update_mode = 'append'; page_load = false; scroll_next = false; updateConvItems(update_mode,data); @@ -627,7 +616,7 @@ function updateConvItems(mode,data) { // As it turns out this causes a bit of an inefficiency // as we're pinging twice for every update, once before // and once after. A btter way to do this is to rewrite - // NavUpdate and perhpas LiveUpdate so that we check for + // NavUpdate and perhaps LiveUpdate so that we check for // post updates first and only call the notification ping // once. -- cgit v1.2.3