infinate scroll
This commit is contained in:
parent
a64fa0839f
commit
bcca61af6b
6 changed files with 36 additions and 10 deletions
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
%ul{:class => 'stream', :id => 'main_stream'}
|
%ul{:class => 'stream', :id => 'main_stream'}
|
||||||
= render 'shared/stream', :posts => @post_hashes
|
= render 'shared/stream', :posts => @post_hashes
|
||||||
|
= will_paginate @posts
|
||||||
|
|
||||||
.span-8.last
|
.span-8.last
|
||||||
= render 'aspects/all_aspects_contacts'
|
= render 'aspects/all_aspects_contacts'
|
||||||
|
|
|
||||||
|
|
@ -25,3 +25,4 @@
|
||||||
|
|
||||||
%ul{:class => 'stream', :id => 'main_stream'}
|
%ul{:class => 'stream', :id => 'main_stream'}
|
||||||
= render 'shared/stream', :posts => @post_hashes
|
= render 'shared/stream', :posts => @post_hashes
|
||||||
|
=will_paginate @posts
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,3 @@
|
||||||
-# the COPYRIGHT file.
|
-# the COPYRIGHT file.
|
||||||
- for post_hash in posts
|
- for post_hash in posts
|
||||||
= render 'shared/stream_element', post_hash.merge(:aspects => @aspects, :commenting_disabled => defined?(@commenting_disabled))
|
= render 'shared/stream_element', post_hash.merge(:aspects => @aspects, :commenting_disabled => defined?(@commenting_disabled))
|
||||||
|
|
||||||
.pagination
|
|
||||||
= will_paginate @posts
|
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ javascripts:
|
||||||
- public/javascripts/vendor/jquery.hotkeys.js
|
- public/javascripts/vendor/jquery.hotkeys.js
|
||||||
- public/javascripts/vendor/jquery.autoresize.min.js
|
- public/javascripts/vendor/jquery.autoresize.min.js
|
||||||
- public/javascripts/vendor/fancybox/jquery.fancybox-1.3.1.pack.js
|
- public/javascripts/vendor/fancybox/jquery.fancybox-1.3.1.pack.js
|
||||||
|
- public/javascripts/vendor/jquery.infinitescroll.min.js
|
||||||
- public/javascripts/vendor/fileuploader.js
|
- public/javascripts/vendor/fileuploader.js
|
||||||
- public/javascripts/view.js
|
- public/javascripts/view.js
|
||||||
- public/javascripts/stream.js
|
- public/javascripts/stream.js
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,25 @@
|
||||||
$(function () {
|
//$(function () {
|
||||||
$('#main_stream .pagination a').live('click', function () {
|
//$('#main_stream .pagination a').live('click', function () {
|
||||||
$.getScript(this.href);
|
//$.getScript(this.href);
|
||||||
return false;
|
//return false;
|
||||||
}
|
//}
|
||||||
);
|
//);
|
||||||
|
//});
|
||||||
|
|
||||||
|
// infinitescroll() is called on the element that surrounds
|
||||||
|
// the items you will be loading more of
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#main_stream').infinitescroll({
|
||||||
|
navSelector : "div.pagination",
|
||||||
|
// selector for the paged navigation (it will be hidden)
|
||||||
|
nextSelector : ".pagination a.next_page",
|
||||||
|
// selector for the NEXT link (to page 2)
|
||||||
|
itemSelector : "#main_stream",
|
||||||
|
// selector for all items you'll retrieve
|
||||||
|
bufferPx: 300,
|
||||||
|
donetext: "no more.",
|
||||||
|
loadingText: "",
|
||||||
|
loadingImg: 'images/ajax-loader.gif'
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
9
public/javascripts/vendor/jquery.infinitescroll.min.js
generated
vendored
Normal file
9
public/javascripts/vendor/jquery.infinitescroll.min.js
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue