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
|
- if current_user.contacts.size < 2
|
||||||
= render 'aspects/no_contacts_message'
|
= 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
|
- if !stream.ajax_stream? && stream.posts.length > 0
|
||||||
= render 'shared/stream', :posts => stream.posts
|
= render 'shared/stream', :posts => stream.posts
|
||||||
#pagination
|
#pagination
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,7 @@
|
||||||
lastTime = $('#main_stream .stream_element').last().find(".time").attr("integer");
|
lastTime = $('#main_stream .stream_element').last().find(".time").attr("integer");
|
||||||
|
|
||||||
if(lastTime === undefined){
|
if(lastTime === undefined){
|
||||||
var currentTime = new Date,
|
lastTime = $('#main_stream').data('time_for_scroll');
|
||||||
unixtimeMs = currentTime.getTime(),
|
|
||||||
lastTime = parseInt(unixtimeMs / 1000);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return newPath.replace(/max_time=\d+/, "max_time=" + lastTime);
|
return newPath.replace(/max_time=\d+/, "max_time=" + lastTime);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue