summaryrefslogtreecommitdiffstats
path: root/webapp/components/suggestion/suggestion_list.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/suggestion/suggestion_list.jsx')
-rw-r--r--webapp/components/suggestion/suggestion_list.jsx18
1 files changed, 6 insertions, 12 deletions
diff --git a/webapp/components/suggestion/suggestion_list.jsx b/webapp/components/suggestion/suggestion_list.jsx
index bc2245077..59f0d02f8 100644
--- a/webapp/components/suggestion/suggestion_list.jsx
+++ b/webapp/components/suggestion/suggestion_list.jsx
@@ -2,20 +2,19 @@
// See License.txt for license information.
import $ from 'jquery';
+import PropTypes from 'prop-types';
+import React from 'react';
import ReactDOM from 'react-dom';
-import * as GlobalActions from 'actions/global_actions.jsx';
-import SuggestionStore from 'stores/suggestion_store.jsx';
import {FormattedMessage} from 'react-intl';
-import PropTypes from 'prop-types';
-
-import React from 'react';
+import SuggestionStore from 'stores/suggestion_store.jsx';
export default class SuggestionList extends React.Component {
static propTypes = {
suggestionId: PropTypes.string.isRequired,
location: PropTypes.string,
- renderDividers: PropTypes.bool
+ renderDividers: PropTypes.bool,
+ onCompleteWord: PropTypes.func.isRequired
};
static defaultProps = {
@@ -29,7 +28,6 @@ export default class SuggestionList extends React.Component {
this.getContent = this.getContent.bind(this);
- this.handleItemClick = this.handleItemClick.bind(this);
this.handleSuggestionsChanged = this.handleSuggestionsChanged.bind(this);
this.scrollToItem = this.scrollToItem.bind(this);
@@ -67,10 +65,6 @@ export default class SuggestionList extends React.Component {
return $(ReactDOM.findDOMNode(this.refs.content));
}
- handleItemClick(term, matchedPretext) {
- GlobalActions.emitCompleteWordSuggestion(this.props.suggestionId, term, matchedPretext);
- }
-
handleSuggestionsChanged() {
this.setState(this.getStateFromStores());
}
@@ -145,7 +139,7 @@ export default class SuggestionList extends React.Component {
term={term}
matchedPretext={this.state.matchedPretext[i]}
isSelection={isSelection}
- onClick={this.handleItemClick}
+ onClick={this.props.onCompleteWord}
/>
);
}