Added permalink feature to posts in the RHS

Этот коммит содержится в:
Reed Garmsen
2016-02-09 13:16:16 -08:00
родитель 45dfd516aa
Коммит 081d5c22c7
4 изменённых файлов: 48 добавлений и 1 удалений

Просмотреть файл

@@ -144,7 +144,8 @@ export default class PostInfo extends React.Component {
);
}
handlePermalink() {
handlePermalink(e) {
e.preventDefault();
EventHelpers.showGetPostLinkModal(this.props.post);
}

Просмотреть файл

@@ -31,6 +31,7 @@ class RhsComment extends React.Component {
this.retryComment = this.retryComment.bind(this);
this.parseEmojis = this.parseEmojis.bind(this);
this.handlePermalink = this.handlePermalink.bind(this);
this.state = {};
}
@@ -67,6 +68,10 @@ class RhsComment extends React.Component {
parseEmojis() {
twemoji.parse(ReactDOM.findDOMNode(this), {size: Constants.EMOJI_SIZE});
}
handlePermalink(e) {
e.preventDefault();
EventHelpers.showGetPostLinkModal(this.props.post);
}
componentDidMount() {
this.parseEmojis();
}
@@ -92,6 +97,23 @@ class RhsComment extends React.Component {
var dropdownContents = [];
dropdownContents.push(
<li
key='rhs-root-permalink'
role='presentation'
>
<a
href='#'
onClick={this.handlePermalink}
>
<FormattedMessage
id='rhs_comment.permalink'
defaultMessage='Permalink'
/>
</a>
</li>
);
if (isOwner) {
dropdownContents.push(
<li

Просмотреть файл

@@ -21,6 +21,7 @@ export default class RhsRootPost extends React.Component {
super(props);
this.parseEmojis = this.parseEmojis.bind(this);
this.handlePermalink = this.handlePermalink.bind(this);
this.state = {};
}
@@ -31,6 +32,10 @@ export default class RhsRootPost extends React.Component {
folder: Emoji.getImagePathForEmoticon()
});
}
handlePermalink(e) {
e.preventDefault();
EventHelpers.showGetPostLinkModal(this.props.post);
}
componentDidMount() {
this.parseEmojis();
}
@@ -83,6 +88,23 @@ export default class RhsRootPost extends React.Component {
var dropdownContents = [];
dropdownContents.push(
<li
key='rhs-root-permalink'
role='presentation'
>
<a
href='#'
onClick={this.handlePermalink}
>
<FormattedMessage
id='rhs_root.permalink'
defaultMessage='Permalink'
/>
</a>
</li>
);
if (isOwner) {
dropdownContents.push(
<li