passing the server time to help intiate the infinite scrolling
This commit is contained in:
parent
513b2cb5bc
commit
3e2b30ec61
2 changed files with 2 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue