Bug 242 - delete error not reported
[osm/UI.git] / skyquake / plugins / composer / src / src / components / PopupWindow.js
1 /**
2 * Created by onvelocity on 2/2/16.
3 */
4
5 import React from 'react'
6 import OpenWindow from 'react-popout'
7 import JSONViewer from 'widgets/JSONViewer/JSONViewer';
8 import ComposerAppActions from '../actions/ComposerAppActions'
9
10 import 'widgets/JSONViewer/JSONViewer.scss'
11
12 window._open = window.open.bind(window);
13 window.open = function monkeyPatchOpen(url, name, options) {
14 const popupWindow = this._open(url, name, options);
15 popupWindow.document.getElementsByTagName('body')[0].focus();
16 return popupWindow;
17 };
18 const h1style = {
19 'paddingTop' : '1rem',
20 'marginLeft': '1rem',
21 'left': 0,
22 'textTransform': 'uppercase',
23 'fontSize': '1.625rem',
24 'fontWeight': 'normal',
25 'fontFamily': 'sans-serif'
26 }
27 export default function (props) {
28 if (!props.show) {
29 return <div></div>;
30 }
31 function onClose() {
32 ComposerAppActions.closeJsonViewer();
33 }
34 return (
35 <OpenWindow title={"RIFT.ware Popup"} onClosing={onClose}>
36 <div style={{backgroundColor: '#f1f1f1', 'paddingBottom': '1rem'}}>
37 <h1 style={h1style}>{props.title}</h1>
38 {props.children}
39 </div>
40 </OpenWindow>
41 );
42 }