Fix keyboard navigation in pools (#3238).
Don't display the search navigation bar when browsing pools. Doing so breaks the A/D keyboard shortcuts because the search navigator takes precedence over the pool navigator. https://danbooru.donmai.us/forum_topics/9127?page=195#forum_post_134297
This commit is contained in:
@@ -196,11 +196,13 @@ class PostPresenter < Presenter
|
||||
end
|
||||
|
||||
def has_nav_links?(template)
|
||||
has_sequential_navigation?(template) || @post.pools.undeleted.any? || @post.favorite_groups(active_id=template.params[:favgroup_id]).any?
|
||||
has_sequential_navigation?(template.params) || @post.pools.undeleted.any? || @post.favorite_groups(active_id=template.params[:favgroup_id]).any?
|
||||
end
|
||||
|
||||
def has_sequential_navigation?(template)
|
||||
CurrentUser.user.enable_sequential_post_navigation && template.params[:tags] !~ /(?:^|\s)(?:order|ordfav|ordpool):/i
|
||||
def has_sequential_navigation?(params)
|
||||
return false if params[:tags] =~ /(?:^|\s)(?:order|ordfav|ordpool):/i
|
||||
return false if params[:pool_id].present? || params[:favgroup_id].present?
|
||||
return CurrentUser.user.enable_sequential_post_navigation
|
||||
end
|
||||
|
||||
def post_footer_for_pool_html(template)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<% if (position == "bottom" && CurrentUser.user.new_post_navigation_layout) || (position == "top" && !CurrentUser.user.new_post_navigation_layout) %>
|
||||
<div id="nav-links" class="ui-corner-all nav-notice">
|
||||
<% if post.presenter.has_sequential_navigation?(self) %>
|
||||
<% if post.presenter.has_sequential_navigation?(params) %>
|
||||
<%= render "posts/partials/show/search_seq", :post => post %>
|
||||
<% end %>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user