diff --git a/app/views/aspects/_aspect_stream.haml b/app/views/aspects/_aspect_stream.haml index 08954106b..c86ae06dc 100644 --- a/app/views/aspects/_aspect_stream.haml +++ b/app/views/aspects/_aspect_stream.haml @@ -19,7 +19,7 @@ - if current_user.contacts.size < 2 = render 'aspects/no_contacts_message' -#main_stream.stream{:data => {:guids => stream.aspect_ids.join(',')}} +#main_stream.stream{:data => {:guids => stream.aspect_ids.join(','), :time_for_scroll => time_for_scroll(stream.ajax_stream?, stream)}} - if !stream.ajax_stream? && stream.posts.length > 0 = render 'shared/stream', :posts => stream.posts #pagination diff --git a/public/javascripts/widgets/infinite-scroll.js b/public/javascripts/widgets/infinite-scroll.js index 36ca113c5..6c3511642 100644 --- a/public/javascripts/widgets/infinite-scroll.js +++ b/public/javascripts/widgets/infinite-scroll.js @@ -20,9 +20,7 @@ lastTime = $('#main_stream .stream_element').last().find(".time").attr("integer"); if(lastTime === undefined){ - var currentTime = new Date, - unixtimeMs = currentTime.getTime(), - lastTime = parseInt(unixtimeMs / 1000); + lastTime = $('#main_stream').data('time_for_scroll'); } return newPath.replace(/max_time=\d+/, "max_time=" + lastTime);