Fix mobile infinite scroll
This commit is contained in:
parent
883ff63ec9
commit
d12ec38736
5 changed files with 15 additions and 11 deletions
|
|
@ -12,7 +12,8 @@
|
|||
= link_to t('.post_a_message'), '#publisher_page', :id => 'publisher_button'
|
||||
#main_stream.stream
|
||||
= render 'shared/stream', :posts => @posts
|
||||
%a.more-link.paginate{:href => aspects_path(:a_ids => params[:a_ids], :page => params[:page] + 1)}
|
||||
%h2= t("more")
|
||||
#pagination
|
||||
%a.more-link.paginate{:href => aspects_path(:a_ids => params[:a_ids], :page => params[:page] + 1)}
|
||||
%h2= t("more")
|
||||
- content_for :subpages do
|
||||
= render 'shared/publisher', :aspect_ids => @aspect_ids
|
||||
|
|
|
|||
|
|
@ -14,4 +14,4 @@
|
|||
.info
|
||||
%span.time
|
||||
= t('ago', :time => time_ago_in_words(post.created_at))
|
||||
= link_to "#{t('comments', :count => post.comments.length)} →", status_message_path(post), :class => 'comment_link right'
|
||||
= link_to "#{t('comments', :count => post.comments.length)} →", status_message_path(post), :class => 'comment_link right ui-link'
|
||||
|
|
|
|||
|
|
@ -10,15 +10,14 @@ var InfiniteScroll = {
|
|||
var newPath = pathStr.replace("?", "?only_posts=true&");
|
||||
return newPath.replace( "page=2", "page=" + nextPage);
|
||||
},
|
||||
bufferPx: 300,
|
||||
bufferPx: 500,
|
||||
debug: false,
|
||||
donetext: "no more.",
|
||||
loadingText: "",
|
||||
loadingImg: '/images/ajax-loader.gif'
|
||||
},
|
||||
postScrollCallback: function(){},
|
||||
initialize: function(){
|
||||
$('#main_stream').infinitescroll(InfiniteScroll.options, function() {
|
||||
Diaspora.widgets.timeago.updateTimeAgo();
|
||||
});
|
||||
$('#main_stream').infinitescroll(InfiniteScroll.options, InfiniteScroll.postScrollCallback);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,3 +38,7 @@ Diaspora.widgets.add("timeago", function() {
|
|||
$(selector || this.selector).timeago();
|
||||
};
|
||||
});
|
||||
|
||||
InfiniteScroll.postScrollCallback = function(){
|
||||
Diaspora.widgets.timeago.updateTimeAgo();
|
||||
}
|
||||
|
|
|
|||
2
vendor/plugins/mobile-fu/lib/mobile_fu.rb
vendored
2
vendor/plugins/mobile-fu/lib/mobile_fu.rb
vendored
|
|
@ -67,7 +67,7 @@ module ActionController
|
|||
# the user has opted to use either the 'Standard' view or 'Mobile' view.
|
||||
|
||||
def set_mobile_format
|
||||
if is_mobile_device? && !request.xhr?
|
||||
if is_mobile_device? && ['/','text/html'].include?(request.format)
|
||||
request.format = session[:mobile_view] == false ? :html : :mobile
|
||||
session[:mobile_view] = true if session[:mobile_view].nil?
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue