Browse Source

Fix hide and show media button on admin page (#6347)

master
abcang 6 years ago
committed by Eugen Rochko
parent
commit
8cd2828e91
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      app/javascript/packs/admin.js

+ 4
- 4
app/javascript/packs/admin.js View File

@ -28,13 +28,13 @@ delegate(document, batchCheckboxClassName, 'change', () => {
});
delegate(document, '.media-spoiler-show-button', 'click', () => {
[].forEach.call(document.querySelectorAll('.activity-stream .media-spoiler-wrapper'), (content) => {
content.classList.add('media-spoiler-wrapper__visible');
[].forEach.call(document.querySelectorAll('button.media-spoiler'), (element) => {
element.click();
});
});
delegate(document, '.media-spoiler-hide-button', 'click', () => {
[].forEach.call(document.querySelectorAll('.activity-stream .media-spoiler-wrapper'), (content) => {
content.classList.remove('media-spoiler-wrapper__visible');
[].forEach.call(document.querySelectorAll('.spoiler-button.spoiler-button--visible button'), (element) => {
element.click();
});
});

Loading…
Cancel
Save