Skip to content

Commit

Permalink
Merge pull request allenhwkim#26 from benhurdavies/fix-overlay-popup-…
Browse files Browse the repository at this point in the history
…close

overlay popup close fix
  • Loading branch information
allenhwkim authored May 22, 2017
2 parents 7f0e882 + 081b796 commit c4790b4
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/custom/popup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,27 @@ import './popup.css';
export class Popup extends React.Component<any, any> {
containerEl: HTMLElement;
contentEl: HTMLElement;
contentClose:HTMLElement;

constructor(props) {
constructor(props) {
console.log(2222222222);
super(props);
}

componentDidMount(){
this.contentClose.addEventListener("click",()=>{
this.containerEl.style.display='none';
});
}

render() {
console.log(3333333333);
return (
<div className="olPopup" ref={el => this.containerEl = el}>
<a className="olPopupCloser"
href="javascript:void(0)"
onClick={this.hide}></a>{/* why this does not work??? */}
ref={el => this.contentClose = el}
></a>
<div className="olPopupContents" ref={el => this.contentEl = el}></div>
</div>
);
Expand All @@ -33,7 +41,4 @@ export class Popup extends React.Component<any, any> {
this.containerEl.style.display = 'block';
}

hide() {
this.containerEl.style.display = 'block';
}
}

0 comments on commit c4790b4

Please sign in to comment.