fix for code fullscreen action on comment page (#11224)

This commit is contained in:
Ivan 2020-11-02 09:57:45 +00:00 committed by GitHub
parent a04726ead2
commit 3ad0e27f8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View 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);
}
});

View file

@ -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 %>