From e9ddd5a159c821e3fb75ff997f40a4bca35c326c Mon Sep 17 00:00:00 2001 From: ThibG Date: Sat, 8 Jun 2019 17:40:59 +0200 Subject: 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 --- app/javascript/packs/public.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'app/javascript/packs') diff --git a/app/javascript/packs/public.js b/app/javascript/packs/public.js index 93379cdb3..3135636cf 100644 --- a/app/javascript/packs/public.js +++ b/app/javascript/packs/public.js @@ -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; -- cgit