Commit e9082330 authored by Eric Duminil's avatar Eric Duminil
Browse files

RegionChooser: Wait until window is ready.

No related merge requests found
Showing with 11 additions and 6 deletions
+11 -6
......@@ -194,10 +194,7 @@ public RegionChooserBrowser() {
if (newState == State.SUCCEEDED) {
JSObject win = (JSObject) webEngine.executeScript("window");
win.setMember("fxapp", fxapp);
webEngine.executeScript("console.log = function(message)\n" +
"{\n" +
" fxapp.log(message);\n" +
"};");
win.call("ready");
try {
fxapp.importNovaFactoryBoundingBoxes();
} catch (Exception ex) {
......
......@@ -159,10 +159,9 @@ var draw = new ol.interaction.Draw({
map.addInteraction(draw);
var sketch;
var fromJavaFX;
var fromJavaFX = false; //Can be overwritten later if launched from JavaFX
draw.on('drawstart', function(evt) {
fromJavaFX = (typeof fxapp !== 'undefined');
sketch = evt.feature;
reset_btn.disabled = false;
updateGMLPolygons();
......@@ -333,4 +332,13 @@ function focusOnMap() {
// $('#map').scrollIntoView();
}
// Executed by JavaFX when whole page is loaded.
window.ready = function() {
fromJavaFX = true;
console.log = function(message){
fxapp.log(message);
}
console.log("READY!");
}
focusOnMap();
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment