fix for code fullscreen action on comment page (#11224)
This commit is contained in:
parent
a04726ead2
commit
3ad0e27f8c
2 changed files with 14 additions and 1 deletions
11
app/javascript/packs/fullScreenModeControl.js
Normal file
11
app/javascript/packs/fullScreenModeControl.js
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import addFullScreenModeControl from '../utilities/codeFullscreenModeSwitcher';
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const fullscreenActionElements = document.querySelectorAll(
|
||||
'.js-fullscreen-code-action',
|
||||
);
|
||||
|
||||
if (fullscreenActionElements) {
|
||||
addFullScreenModeControl(fullscreenActionElements);
|
||||
}
|
||||
});
|
||||
|
|
@ -77,7 +77,7 @@
|
|||
data-commentable-type="<%= @commentable.class.name %>">
|
||||
<% if @root_comment %>
|
||||
<div id="response-templates-data"></div>
|
||||
<%= javascript_packs_with_chunks_tag "responseTemplates", defer: true %>
|
||||
<%= javascript_packs_with_chunks_tag "responseTemplates", "fullScreenModeControl", defer: true %>
|
||||
<div class="top-level-actions">
|
||||
<h3>re: <%= @commentable.title %> <a href="<%= @commentable.path %>">VIEW POST</a></h3>
|
||||
<span class="comment-action-buttons">
|
||||
|
|
@ -128,6 +128,8 @@
|
|||
<%= render "articles/fitvids" %>
|
||||
<% end %>
|
||||
|
||||
<div class="fullscreen-code js-fullscreen-code"></div>
|
||||
|
||||
<script async>
|
||||
<%== TweetTag.script %>
|
||||
<%== YoutubeTag.script %>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue