diff options
-rw-r--r-- | chimere/static/saclay/js/interface.js | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/chimere/static/saclay/js/interface.js b/chimere/static/saclay/js/interface.js index 229624a..79f8f81 100644 --- a/chimere/static/saclay/js/interface.js +++ b/chimere/static/saclay/js/interface.js @@ -193,6 +193,19 @@ var edit_panel_open = function(){ */ }; +var init_map_edit; + +var map_edit_init = function(){ + // ol3 must be initialized after modal opening + if (init_map_edit){ + init_map_edit(); + $('#map_edit').chimere('refresh'); + $("#modal-edit").modal('handleUpdate'); + } else { + setTimeout(map_edit_init, 500); + } +}; + $(function(){ $('#action-routing').click(routing_panel_open); $('#routing-button').click(routing_panel_open); @@ -220,10 +233,7 @@ $(function(){ }); $("#modal-edit").on('shown.bs.modal', function () { - // ol3 must be initialized after modal opening - init_map_edit(); - $('#map_edit').chimere('refresh'); - $("#modal-edit").modal('handleUpdate'); + map_edit_init(); }); $("#action-carte").click(action_map); |