]> cat aescling's git repositories - mastodon.git/commitdiff
Simplify passing of prop
authorEugen Rochko <eugen@zeonfederated.com>
Wed, 1 Mar 2017 12:57:30 +0000 (13:57 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Wed, 1 Mar 2017 12:57:30 +0000 (13:57 +0100)
app/assets/javascripts/components/features/compose/components/compose_form.jsx

index a71f5b0fddacc5b442231db3837eb2f39be74725..bcc4fe1e732a5fa35b3fccc496edcfe2be3186d3 100644 (file)
@@ -83,10 +83,6 @@ const ComposeForm = React.createClass({
     this.props.onChangeSpoilerText(e.target.value);
   },
 
-  onPaste (files) {
-    this.props.onPaste(files);
-  },
-
   componentDidUpdate (prevProps) {
     if (this.props.focusDate !== prevProps.focusDate) {
       // If replying to zero or one users, places the cursor at the end of the textbox.
@@ -105,7 +101,7 @@ const ComposeForm = React.createClass({
   },
 
   render () {
-    const { intl, needsPrivacyWarning, mentionedDomains } = this.props;
+    const { intl, needsPrivacyWarning, mentionedDomains, onPaste } = this.props;
     const disabled = this.props.is_submitting || this.props.is_uploading;
 
     let publishText    = '';
@@ -154,7 +150,7 @@ const ComposeForm = React.createClass({
           onSuggestionsFetchRequested={this.onSuggestionsFetchRequested}
           onSuggestionsClearRequested={this.onSuggestionsClearRequested}
           onSuggestionSelected={this.onSuggestionSelected}
-          onPaste={this.onPaste}
+          onPaste={onPaste}
         />
 
         <div style={{ marginTop: '10px', overflow: 'hidden' }}>