summaryrefslogtreecommitdiffstats
path: root/web/react/components/search_results_item.jsx
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-11-18 17:29:06 -0500
committerChristopher Speller <crspeller@gmail.com>2015-11-23 09:53:15 -0500
commit9e8cd937908d5d2e730e94f761d6533eb2d95e28 (patch)
treefb6324a5896da7123b76854e7eb504c239113824 /web/react/components/search_results_item.jsx
parent5ee226d7f92d9408736b0e2a9ff105eb6f520a19 (diff)
downloadchat-9e8cd937908d5d2e730e94f761d6533eb2d95e28.tar.gz
chat-9e8cd937908d5d2e730e94f761d6533eb2d95e28.tar.bz2
chat-9e8cd937908d5d2e730e94f761d6533eb2d95e28.zip
Implementing Permalinks and jumping to post from search. Performance
improvements.
Diffstat (limited to 'web/react/components/search_results_item.jsx')
-rw-r--r--web/react/components/search_results_item.jsx34
1 files changed, 2 insertions, 32 deletions
diff --git a/web/react/components/search_results_item.jsx b/web/react/components/search_results_item.jsx
index 2202831a3..da422fe1b 100644
--- a/web/react/components/search_results_item.jsx
+++ b/web/react/components/search_results_item.jsx
@@ -1,17 +1,12 @@
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
-import SearchStore from '../stores/search_store.jsx';
import ChannelStore from '../stores/channel_store.jsx';
import UserStore from '../stores/user_store.jsx';
import UserProfile from './user_profile.jsx';
+import * as EventHelpers from '../dispatcher/event_helpers.jsx';
import * as utils from '../utils/utils.jsx';
-import * as client from '../utils/client.jsx';
-import * as AsyncClient from '../utils/async_client.jsx';
-import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
-import Constants from '../utils/constants.jsx';
import * as TextFormatting from '../utils/text_formatting.jsx';
-var ActionTypes = Constants.ActionTypes;
export default class SearchResultsItem extends React.Component {
constructor(props) {
@@ -23,32 +18,7 @@ export default class SearchResultsItem extends React.Component {
handleClick(e) {
e.preventDefault();
- var self = this;
-
- client.getPost(
- this.props.post.channel_id,
- this.props.post.id,
- function success(data) {
- AppDispatcher.handleServerAction({
- type: ActionTypes.RECIEVED_POST_SELECTED,
- post_list: data,
- from_search: SearchStore.getSearchTerm()
- });
-
- AppDispatcher.handleServerAction({
- type: ActionTypes.RECIEVED_SEARCH,
- results: null,
- is_mention_search: self.props.isMentionSearch
- });
- },
- function success(err) {
- AsyncClient.dispatchError(err, 'getPost');
- }
- );
-
- var postChannel = ChannelStore.get(this.props.post.channel_id);
-
- utils.switchChannel(postChannel);
+ EventHelpers.emitPostFocusEvent(this.props.post.id);
}
render() {