X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fplugins%2Fcomposer%2Fsrc%2Fsrc%2Fcomponents%2FPopupWindow.js;fp=skyquake%2Fplugins%2Fcomposer%2Fsrc%2Fsrc%2Fcomponents%2FPopupWindow.js;h=36b08e1941f786e0e8c3173627b1a7922164f302;hb=e29efc315df33d546237e270470916e26df391d6;hp=0000000000000000000000000000000000000000;hpb=9c5e457509ba5a1822c316635c6308874e61b4b9;p=osm%2FUI.git diff --git a/skyquake/plugins/composer/src/src/components/PopupWindow.js b/skyquake/plugins/composer/src/src/components/PopupWindow.js new file mode 100644 index 000000000..36b08e194 --- /dev/null +++ b/skyquake/plugins/composer/src/src/components/PopupWindow.js @@ -0,0 +1,42 @@ +/** + * Created by onvelocity on 2/2/16. + */ + +import React from 'react' +import OpenWindow from 'react-popout' +import JSONViewer from 'widgets/JSONViewer/JSONViewer'; +import ComposerAppActions from '../actions/ComposerAppActions' + +import 'widgets/JSONViewer/JSONViewer.scss' + +window._open = window.open.bind(window); +window.open = function monkeyPatchOpen(url, name, options) { + const popupWindow = this._open(url, name, options); + popupWindow.document.getElementsByTagName('body')[0].focus(); + return popupWindow; +}; +const h1style = { + 'paddingTop' : '1rem', + 'marginLeft': '1rem', + 'left': 0, + 'textTransform': 'uppercase', + 'fontSize': '1.625rem', + 'fontWeight': 'normal', + 'fontFamily': 'sans-serif' +} +export default function (props) { + if (!props.show) { + return
; + } + function onClose() { + ComposerAppActions.closeJsonViewer(); + } + return ( + +
+

{props.title}

+ {props.children} +
+
+ ); +}