Fix feed link for pushState loaded history page
This commit is contained in:
parent
51ade94113
commit
6b236ec95b
5 changed files with 19 additions and 4 deletions
|
@ -42,10 +42,22 @@
|
|||
clearTimeout(loaderTimeout);
|
||||
$('#flash').empty();
|
||||
$('#sidebar_loader').hide();
|
||||
$('#sidebar_content').html(xhr.responseText);
|
||||
|
||||
var content = $(xhr.responseText);
|
||||
|
||||
if (xhr.getResponseHeader('X-Page-Title')) {
|
||||
document.title = xhr.getResponseHeader('X-Page-Title');
|
||||
}
|
||||
|
||||
$('head')
|
||||
.find('link[type="application/atom+xml"]')
|
||||
.remove();
|
||||
|
||||
$('head')
|
||||
.append(content.filter('link[type="application/atom+xml"]'));
|
||||
|
||||
$('#sidebar_content').html(content.not('link[type="application/atom+xml"]'));
|
||||
|
||||
if (callback) {
|
||||
callback();
|
||||
}
|
||||
|
|
|
@ -419,7 +419,7 @@ class ApplicationController < ActionController::Base
|
|||
end
|
||||
|
||||
def map_layout
|
||||
request.xhr? ? false : 'map'
|
||||
request.xhr? ? 'xhr' : 'map'
|
||||
end
|
||||
|
||||
def preferred_editor
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<% content_for :head do -%>
|
||||
<% content_for :auto_discovery_link_tag do -%>
|
||||
<% unless params[:friends] or params[:nearby] -%>
|
||||
<%= auto_discovery_link_tag :atom, params.merge({ :max_id => nil, :action => :feed }) %>
|
||||
<%= auto_discovery_link_tag :atom, params.merge(:max_id => nil, :xhr => nil, :action => :feed) %>
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
<% end -%>
|
||||
<%= style_rules %>
|
||||
<%= yield :head %>
|
||||
<%= yield :auto_discovery_link_tag %>
|
||||
<%= csrf_meta_tag %>
|
||||
<script type="text/javascript">
|
||||
I18n.defaultLocale = "<%= I18n.default_locale %>";
|
||||
|
|
2
app/views/layouts/xhr.html.erb
Normal file
2
app/views/layouts/xhr.html.erb
Normal file
|
@ -0,0 +1,2 @@
|
|||
<%= content_for :auto_discovery_link_tag %>
|
||||
<%= yield %>
|
Loading…
Add table
Add a link
Reference in a new issue