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