passing the server time to help intiate the infinite scrolling

This commit is contained in:
Ilya Zhitomirskiy 2011-10-05 15:12:16 -07:00
parent 513b2cb5bc
commit 3e2b30ec61
2 changed files with 2 additions and 4 deletions

View file

@ -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

View file

@ -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);