0
0
Fork 0

Put poll options behind content warnings (#10983)

* Put poll options behind CWs in WebUI

* Put polls behind CWs on public pages

* Add poll icon to public pages CWs

* Revert to not showing an icon in the CW button
This commit is contained in:
ThibG 2019-06-08 17:40:59 +02:00 committed by Eugen Rochko
parent 20dda5cca0
commit e9ddd5a159
6 changed files with 36 additions and 27 deletions

View file

@ -126,15 +126,15 @@ function main() {
return false;
});
delegate(document, '.status__content__spoiler-link', 'click', ({ target }) => {
const contentEl = target.parentNode.parentNode.querySelector('.e-content');
delegate(document, '.status__content__spoiler-link', 'click', function() {
const contentEl = this.parentNode.parentNode.querySelector('.e-content');
if (contentEl.style.display === 'block') {
contentEl.style.display = 'none';
target.parentNode.style.marginBottom = 0;
this.parentNode.style.marginBottom = 0;
} else {
contentEl.style.display = 'block';
target.parentNode.style.marginBottom = null;
this.parentNode.style.marginBottom = null;
}
return false;