Fix feed link for pushState loaded history page

This commit is contained in:
John Firebaugh 2013-11-25 15:46:14 -08:00
parent 51ade94113
commit 6b236ec95b
5 changed files with 19 additions and 4 deletions

View file

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

View file

@ -419,7 +419,7 @@ class ApplicationController < ActionController::Base
end
def map_layout
request.xhr? ? false : 'map'
request.xhr? ? 'xhr' : 'map'
end
def preferred_editor

View file

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

View file

@ -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 %>";

View file

@ -0,0 +1,2 @@
<%= content_for :auto_discovery_link_tag %>
<%= yield %>