PLT-1418 Adding old style replying in RHS
Этот коммит содержится в:
@@ -8,11 +8,14 @@ import * as EventHelpers from '../dispatcher/event_helpers.jsx';
|
|||||||
import * as utils from '../utils/utils.jsx';
|
import * as utils from '../utils/utils.jsx';
|
||||||
import * as TextFormatting from '../utils/text_formatting.jsx';
|
import * as TextFormatting from '../utils/text_formatting.jsx';
|
||||||
|
|
||||||
|
import Constants from '../utils/constants.jsx';
|
||||||
|
|
||||||
export default class SearchResultsItem extends React.Component {
|
export default class SearchResultsItem extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.handleClick = this.handleClick.bind(this);
|
this.handleClick = this.handleClick.bind(this);
|
||||||
|
this.handleFocusRHSClick = this.handleFocusRHSClick.bind(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleClick(e) {
|
handleClick(e) {
|
||||||
@@ -21,6 +24,12 @@ export default class SearchResultsItem extends React.Component {
|
|||||||
EventHelpers.emitPostFocusEvent(this.props.post.id);
|
EventHelpers.emitPostFocusEvent(this.props.post.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleFocusRHSClick(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
|
EventHelpers.emitPostFocusRightHandSideEvent(this.props.post);
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
var channelName = '';
|
var channelName = '';
|
||||||
var channel = ChannelStore.get(this.props.post.channel_id);
|
var channel = ChannelStore.get(this.props.post.channel_id);
|
||||||
@@ -65,13 +74,24 @@ export default class SearchResultsItem extends React.Component {
|
|||||||
className='search-item__jump'
|
className='search-item__jump'
|
||||||
onClick={this.handleClick}
|
onClick={this.handleClick}
|
||||||
>
|
>
|
||||||
{<i className='fa fa-mail-reply'></i>}
|
<i className='fa fa-mail-reply'></i>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a
|
||||||
|
href='#'
|
||||||
|
className='comment-icon__container search-item__comment'
|
||||||
|
onClick={this.handleFocusRHSClick}
|
||||||
|
>
|
||||||
|
<span
|
||||||
|
className='comment-icon'
|
||||||
|
dangerouslySetInnerHTML={{__html: Constants.COMMENT_ICON}}
|
||||||
|
/>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div className='search-item-snippet'>
|
<div className='search-item-snippet'>
|
||||||
<span
|
<span
|
||||||
onClick={this.handleClick}
|
|
||||||
dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.props.post.message, formattingOptions)}}
|
dangerouslySetInnerHTML={{__html: TextFormatting.formatText(this.props.post.message, formattingOptions)}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ 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';
|
||||||
import * as Client from '../utils/client.jsx';
|
import * as Client from '../utils/client.jsx';
|
||||||
|
import * as Utils from '../utils/utils.jsx';
|
||||||
|
|
||||||
export function emitChannelClickEvent(channel) {
|
export function emitChannelClickEvent(channel) {
|
||||||
AsyncClient.getChannels(true);
|
AsyncClient.getChannels(true);
|
||||||
@@ -38,6 +39,30 @@ export function emitPostFocusEvent(postId) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function emitPostFocusRightHandSideEvent(post) {
|
||||||
|
Client.getPost(
|
||||||
|
post.channel_id,
|
||||||
|
post.id,
|
||||||
|
(data) => {
|
||||||
|
AppDispatcher.handleServerAction({
|
||||||
|
type: ActionTypes.RECIEVED_POST_SELECTED,
|
||||||
|
post_list: data
|
||||||
|
});
|
||||||
|
|
||||||
|
AppDispatcher.handleServerAction({
|
||||||
|
type: ActionTypes.RECIEVED_SEARCH,
|
||||||
|
results: null
|
||||||
|
});
|
||||||
|
},
|
||||||
|
(err) => {
|
||||||
|
AsyncClient.dispatchError(err, 'getPost');
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
var postChannel = ChannelStore.get(post.channel_id);
|
||||||
|
Utils.switchChannel(postChannel);
|
||||||
|
}
|
||||||
|
|
||||||
export function emitLoadMorePostsEvent() {
|
export function emitLoadMorePostsEvent() {
|
||||||
const id = ChannelStore.getCurrentId();
|
const id = ChannelStore.getCurrentId();
|
||||||
loadMorePostsTop(id);
|
loadMorePostsTop(id);
|
||||||
|
|||||||
@@ -114,6 +114,13 @@
|
|||||||
top: 0;
|
top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search-item__comment {
|
||||||
|
position: absolute;
|
||||||
|
right: 0;
|
||||||
|
margin-right: 20px;
|
||||||
|
top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.search-item-time {
|
.search-item-time {
|
||||||
color: #a8adb7;
|
color: #a8adb7;
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user