ruffle: fix issue with ruffle falsely triggering keyboard shortcuts.

Fix issue mentioned in 55980c6fb with Javascript spazzing out on Flash
posts and randomly triggering keyboard shortcuts.

The bug was calling `javascript_pack_tag` twice. This caused the
runtime Javascript chunk to be loaded twice, caused a lot of Javascript
errors that somehow resulted in keyboard shortcuts being triggered.

The fix is to combine both calls into `javascript_pack_tag "application", "flash"`.

hxxps://github.com.rails.webpacker.issues.2932
This commit is contained in:
evazion
2021-03-31 22:10:04 -05:00
parent 946b4cc960
commit fff68e1d16
3 changed files with 23 additions and 7 deletions

View File

@@ -1,8 +1,3 @@
<%= content_tag(:object, :width => post.image_width, :height => post.image_height) do %>
<%= tag :params, :name => "movie", :value => post.tagged_file_url %>
<%= tag :embed, :src => post.tagged_file_url, :width => post.image_width, :height => post.image_height, :allowScriptAccess => "never" %>
<% end %>
<div class="ruffle-container" data-swf="<%= post.tagged_file_url %>"></div>
<p><%= link_to "Save this flash (right click and save)", post.tagged_file_url %></p>
<%= javascript_pack_tag "flash" %>