Skip to content

Commit

Permalink
Quote using innerText
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Barnard committed Aug 10, 2017
1 parent 3e96892 commit 57f82c3
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/components/views/context_menus/MessageContextMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,9 @@ module.exports = React.createClass({
},

onQuoteClick: function() {
console.log(this.props.mxEvent);
dis.dispatch({
action: 'quote',
event: this.props.mxEvent,
text: this.props.eventTileOps.getInnerText(),
});
this.closeMenu();
},
Expand All @@ -153,6 +152,7 @@ module.exports = React.createClass({
let unhidePreviewButton;
let permalinkButton;
let externalURLButton;
let quoteButton;

if (eventStatus === 'not_sent') {
resendButton = (
Expand Down Expand Up @@ -221,11 +221,13 @@ module.exports = React.createClass({
</div>
);

const quoteButton = (
<div className="mx_MessageContextMenu_field" onClick={this.onQuoteClick}>
{ _t('Quote') }
</div>
);
if (this.props.eventTileOps && this.props.eventTileOps.getInnerText) {
quoteButton = (
<div className="mx_MessageContextMenu_field" onClick={this.onQuoteClick}>
{ _t('Quote') }
</div>
);
}

// Bridges can provide a 'external_url' to link back to the source.
if( typeof(this.props.mxEvent.event.content.external_url) === "string") {
Expand Down

0 comments on commit 57f82c3

Please sign in to comment.