PLT-1472 Adding back button to search click through
Этот коммит содержится в:
@@ -31,8 +31,7 @@ export default class SearchResultsItem extends React.Component {
|
|||||||
|
|
||||||
handleFocusRHSClick(e) {
|
handleFocusRHSClick(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
EventHelpers.emitPostFocusRightHandSideFromSearch(this.props.post, this.props.isMentionSearch);
|
||||||
EventHelpers.emitPostFocusRightHandSideEvent(this.props.post);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
|
import AppDispatcher from '../dispatcher/app_dispatcher.jsx';
|
||||||
import ChannelStore from '../stores/channel_store.jsx';
|
import ChannelStore from '../stores/channel_store.jsx';
|
||||||
import PostStore from '../stores/post_store.jsx';
|
import PostStore from '../stores/post_store.jsx';
|
||||||
|
import SearchStore from '../stores/search_store.jsx';
|
||||||
import Constants from '../utils/constants.jsx';
|
import Constants from '../utils/constants.jsx';
|
||||||
const ActionTypes = Constants.ActionTypes;
|
const ActionTypes = Constants.ActionTypes;
|
||||||
import * as AsyncClient from '../utils/async_client.jsx';
|
import * as AsyncClient from '../utils/async_client.jsx';
|
||||||
@@ -39,28 +40,27 @@ export function emitPostFocusEvent(postId) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function emitPostFocusRightHandSideEvent(post) {
|
export function emitPostFocusRightHandSideFromSearch(post, isMentionSearch) {
|
||||||
Client.getPost(
|
Client.getPost(
|
||||||
post.channel_id,
|
post.channel_id,
|
||||||
post.id,
|
post.id,
|
||||||
(data) => {
|
(data) => {
|
||||||
AppDispatcher.handleServerAction({
|
AppDispatcher.handleServerAction({
|
||||||
type: ActionTypes.RECIEVED_POST_SELECTED,
|
type: ActionTypes.RECIEVED_POST_SELECTED,
|
||||||
post_list: data
|
post_list: data,
|
||||||
|
from_search: SearchStore.getSearchTerm()
|
||||||
});
|
});
|
||||||
|
|
||||||
AppDispatcher.handleServerAction({
|
AppDispatcher.handleServerAction({
|
||||||
type: ActionTypes.RECIEVED_SEARCH,
|
type: ActionTypes.RECIEVED_SEARCH,
|
||||||
results: null
|
results: null,
|
||||||
|
is_mention_search: isMentionSearch
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
(err) => {
|
(err) => {
|
||||||
AsyncClient.dispatchError(err, 'getPost');
|
AsyncClient.dispatchError(err, 'getPost');
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
var postChannel = ChannelStore.get(post.channel_id);
|
|
||||||
Utils.switchChannel(postChannel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function emitLoadMorePostsEvent() {
|
export function emitLoadMorePostsEvent() {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user