about summary refs log tree commit diff
path: root/app/javascript/mastodon/components/poll.js
diff options
context:
space:
mode:
authorTakeshi Umeda <noel.yoshiba@gmail.com>2019-05-27 06:13:29 +0900
committerEugen Rochko <eugen@zeonfederated.com>2019-05-26 23:13:29 +0200
commit3b9c02506d5046a66ff84b2c787098481a27bda7 (patch)
treeef4f82ba14404646ab7cae4c69658c9748907f89 /app/javascript/mastodon/components/poll.js
parent1e6a1ea075b367e68c043fedafffe3bdca13cf82 (diff)
Fix poll visibility on public pages (#10817)
* Fix poll visibility on public pages

* Revert "Fix poll visibility on public pages"

This reverts commit 54a9608add6f855bc6337fe3c65eaee7ba13db49.

* Revert "Change poll options to alphabetic letters when status text is hidden"

This reverts commit c53d67326201b2061990b1874a3547c3647f50d2.
Diffstat (limited to 'app/javascript/mastodon/components/poll.js')
-rw-r--r--app/javascript/mastodon/components/poll.js14
1 files changed, 6 insertions, 8 deletions
diff --git a/app/javascript/mastodon/components/poll.js b/app/javascript/mastodon/components/poll.js
index acab107a1..690f9ae5a 100644
--- a/app/javascript/mastodon/components/poll.js
+++ b/app/javascript/mastodon/components/poll.js
@@ -28,7 +28,6 @@ class Poll extends ImmutablePureComponent {
     intl: PropTypes.object.isRequired,
     dispatch: PropTypes.func,
     disabled: PropTypes.bool,
-    visible: PropTypes.bool,
   };
 
   state = {
@@ -70,14 +69,13 @@ class Poll extends ImmutablePureComponent {
   };
 
   renderOption (option, optionIndex) {
-    const { poll, disabled, visible } = this.props;
-    const percent     = poll.get('votes_count') === 0 ? 0 : (option.get('votes_count') / poll.get('votes_count')) * 100;
-    const leading     = poll.get('options').filterNot(other => other.get('title') === option.get('title')).every(other => option.get('votes_count') > other.get('votes_count'));
-    const active      = !!this.state.selected[`${optionIndex}`];
-    const showResults = poll.get('voted') || poll.get('expired');
+    const { poll, disabled } = this.props;
+    const percent            = poll.get('votes_count') === 0 ? 0 : (option.get('votes_count') / poll.get('votes_count')) * 100;
+    const leading            = poll.get('options').filterNot(other => other.get('title') === option.get('title')).every(other => option.get('votes_count') > other.get('votes_count'));
+    const active             = !!this.state.selected[`${optionIndex}`];
+    const showResults        = poll.get('voted') || poll.get('expired');
 
     let titleEmojified = option.get('title_emojified');
-
     if (!titleEmojified) {
       const emojiMap = makeEmojiMap(poll);
       titleEmojified = emojify(escapeTextContentForBrowser(option.get('title')), emojiMap);
@@ -106,7 +104,7 @@ class Poll extends ImmutablePureComponent {
           {!showResults && <span className={classNames('poll__input', { checkbox: poll.get('multiple'), active })} />}
           {showResults && <span className='poll__number'>{Math.round(percent)}%</span>}
 
-          {visible ? <span dangerouslySetInnerHTML={{ __html: titleEmojified }} /> : <span>{String.fromCharCode(64 + optionIndex + 1)}</span>}
+          <span dangerouslySetInnerHTML={{ __html: titleEmojified }} />
         </label>
       </li>
     );