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

lolsob-rspec
abcang 2018-01-24 21:29:46 +09:00 committed by Eugen Rochko
parent b190de470a
commit 83a68aa224
1 changed files with 4 additions and 4 deletions

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