Iframe.js
7 years ago
core-embeds.js
7 years ago
embed-controls.js
6 years ago
embed-loading.js
7 years ago
embed-placeholder.js
6 years ago
icons.js
5 years ago
Iframe.js
29 lines
| 1 | /* |
| 2 | INIT: ensure Babel/Eslint/Flow is configured for ES Class Fields & Static Properties |
| 3 | JSX USAGE: <Iframe src='http://web.site' onLoad={myOnloadFunction}/> |
| 4 | */ |
| 5 | import ReactDOM from 'react-dom' |
| 6 | const { Component } = wp.element; |
| 7 | |
| 8 | class Iframe extends Component { |
| 9 | |
| 10 | componentDidMount () { |
| 11 | let iframe = ReactDOM.findDOMNode(this.refs.iframe) |
| 12 | iframe.addEventListener('load', this.props.onLoad); |
| 13 | } |
| 14 | |
| 15 | render () { |
| 16 | |
| 17 | return ( |
| 18 | <iframe |
| 19 | ref="iframe" |
| 20 | {...this.props} |
| 21 | |
| 22 | /> |
| 23 | ) |
| 24 | } |
| 25 | |
| 26 | } |
| 27 | |
| 28 | export default Iframe |
| 29 |