diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-03-12 13:44:30 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-03-12 13:44:30 +0100 |
commit | 6bf38680ce067533a887e35a99793d0981a357f5 (patch) | |
tree | f4511792f4a6d770a9a2b5d120d88a8f6ad50390 | |
parent | 7cc97e28cb7c9c7888d11a5281fcfb4f70a49578 (diff) | |
download | Chimère-6bf38680ce067533a887e35a99793d0981a357f5.tar.bz2 Chimère-6bf38680ce067533a887e35a99793d0981a357f5.zip |
Fix heratic bad initialization of the form
-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); |