Skip to content

Commit

Permalink
Use component state to highlight edit button on client side. (mozilla…
Browse files Browse the repository at this point in the history
  • Loading branch information
chenba authored and Moritz Brunner committed Jun 7, 2018
1 parent 9348130 commit 6e7b3f6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion server/src/pages/shot/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ class Body extends React.Component {
};
}

componentDidMount() {
this.setState({highlightEditButton: this.props.highlightEditButton});
}

doCloseBanner() {
this.setState({closeBanner: true});
}
Expand Down Expand Up @@ -344,7 +348,7 @@ class Body extends React.Component {

let trashOrFlagButton;
let editButton;
const highlight = this.props.highlightEditButton ? <div className="edit-highlight" onClick={ this.onClickEdit.bind(this) } onMouseOver={ this.onMouseOverHighlight.bind(this) } onMouseOut={ this.onMouseOutHighlight.bind(this) }></div> : null;
const highlight = this.state.highlightEditButton ? <div className="edit-highlight" onClick={ this.onClickEdit.bind(this) } onMouseOver={ this.onMouseOverHighlight.bind(this) } onMouseOut={ this.onMouseOutHighlight.bind(this) }></div> : null;
if (this.props.isOwner) {
trashOrFlagButton = <Localized id="shotPageDeleteButton">
<button className="button transparent trash" title="Delete this shot permanently" onClick={ this.onClickDelete.bind(this) }></button>
Expand Down

0 comments on commit 6e7b3f6

Please # to comment.