mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-15 04:02:38 +00:00
Emit click event when iFrame clicked
This commit is contained in:
@@ -185,6 +185,12 @@ const BrewRenderer = createClass({
|
|||||||
}, 100);
|
}, 100);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
emitClick : function(){
|
||||||
|
// console.log('iFrame clicked');
|
||||||
|
if(!window || !document) return;
|
||||||
|
document.dispatchEvent(new MouseEvent('click'));
|
||||||
|
},
|
||||||
|
|
||||||
render : function(){
|
render : function(){
|
||||||
//render in iFrame so broken code doesn't crash the site.
|
//render in iFrame so broken code doesn't crash the site.
|
||||||
//Also render dummy page while iframe is mounting.
|
//Also render dummy page while iframe is mounting.
|
||||||
@@ -203,7 +209,9 @@ const BrewRenderer = createClass({
|
|||||||
|
|
||||||
<Frame id='BrewRenderer' initialContent={this.state.initialContent}
|
<Frame id='BrewRenderer' initialContent={this.state.initialContent}
|
||||||
style={{ width: '100%', height: '100%', visibility: this.state.visibility }}
|
style={{ width: '100%', height: '100%', visibility: this.state.visibility }}
|
||||||
contentDidMount={this.frameDidMount}>
|
contentDidMount={this.frameDidMount}
|
||||||
|
onClick={()=>{this.emitClick();}}
|
||||||
|
>
|
||||||
<div className={'brewRenderer'}
|
<div className={'brewRenderer'}
|
||||||
onScroll={this.handleScroll}
|
onScroll={this.handleScroll}
|
||||||
style={{ height: this.state.height }}>
|
style={{ height: this.state.height }}>
|
||||||
|
|||||||
Reference in New Issue
Block a user