posts: fix post view counts not being recorded.

Broken by the upgrade to webpacker-6.0.0.rc.6. Webpacker now defaults to
loading the Javascript bundle with `<script src="..." defer>`, which
means Javascript won't be loaded until after the page loads, which broke
the code that records view counts because it uses jQuery and jQuery
wasn't loaded yet.
This commit is contained in:
evazion
2022-01-24 01:53:30 -06:00
parent 0213f8d76a
commit 5c97595c6a
2 changed files with 3 additions and 3 deletions

View File

@@ -8,7 +8,7 @@
<link rel="top" title="<%= Danbooru.config.app_name %>" href="/">
<%= csrf_meta_tag %>
<%= raw Danbooru.config.custom_html_header_content %>
<%= javascript_pack_tag "application" %>
<%= javascript_pack_tag "application", defer: false %>
<%= stylesheet_pack_tag "application" %>
<%= yield :html_header %>
</head>

View File

@@ -22,9 +22,9 @@
<%# XXX hack to only load Ruffle on Flash posts %>
<% if controller_name == "posts" && action_name == "show" && @post&.is_flash? %>
<%= javascript_pack_tag "application", "flash" %>
<%= javascript_pack_tag "application", "flash", defer: false %>
<% else %>
<%= javascript_pack_tag "application" %>
<%= javascript_pack_tag "application", defer: false %>
<% end %>
<%= stylesheet_pack_tag "application" %>