From 28907070bfe69f2746564344809b41e55ffd6200 Mon Sep 17 00:00:00 2001 From: Koala Yeung Date: Sat, 15 Apr 2017 08:57:26 +0800 Subject: [PATCH] jslint: fix jslint warnings (#1704) * jslint: remove trailing space * jslint: fix no-nested-ternary issue Follow the jslint [no-nested-ternary](http://eslint.org/docs/rules/no-nested-ternary) rule. Rewritten ternary with if-then. --- .../javascripts/components/components/status_action_bar.jsx | 6 +++++- .../components/features/compose/components/compose_form.jsx | 2 +- .../components/features/status/components/action_bar.jsx | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/components/components/status_action_bar.jsx b/app/assets/javascripts/components/components/status_action_bar.jsx index 02424e77c5..5119607177 100644 --- a/app/assets/javascripts/components/components/status_action_bar.jsx +++ b/app/assets/javascripts/components/components/status_action_bar.jsx @@ -92,10 +92,14 @@ const StatusActionBar = React.createClass({ menu.push({ text: intl.formatMessage(messages.report, { name: status.getIn(['account', 'username']) }), action: this.handleReport }); } + let reblogIcon = 'retweet'; + if (status.get('visibility') === 'direct') reblogIcon = 'envelope'; + else if (status.get('visibility') === 'private') reblogIcon = 'lock'; + return (
-
+
diff --git a/app/assets/javascripts/components/features/compose/components/compose_form.jsx b/app/assets/javascripts/components/features/compose/components/compose_form.jsx index d2e65359fb..c7df22765b 100644 --- a/app/assets/javascripts/components/features/compose/components/compose_form.jsx +++ b/app/assets/javascripts/components/features/compose/components/compose_form.jsx @@ -92,7 +92,7 @@ const ComposeForm = React.createClass({ }, componentDidUpdate (prevProps) { - // This statement does several things: + // This statement does several things: // - If we're beginning a reply, and, // - Replying to zero or one users, places the cursor at the end of the textbox. // - Replying to more than one user, selects any usernames past the first; diff --git a/app/assets/javascripts/components/features/status/components/action_bar.jsx b/app/assets/javascripts/components/features/status/components/action_bar.jsx index fdcb8b9806..f88f25f375 100644 --- a/app/assets/javascripts/components/features/status/components/action_bar.jsx +++ b/app/assets/javascripts/components/features/status/components/action_bar.jsx @@ -71,10 +71,14 @@ const ActionBar = React.createClass({ menu.push({ text: intl.formatMessage(messages.report, { name: status.getIn(['account', 'username']) }), action: this.handleReport }); } + let reblogIcon = 'retweet'; + if (status.get('visibility') === 'direct') reblogIcon = 'envelope'; + else if (status.get('visibility') === 'private') reblogIcon = 'lock'; + return (
-
+