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:
@@ -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>
|
||||
|
||||
@@ -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" %>
|
||||
|
||||
Reference in New Issue
Block a user