diff --git a/horusmapper.py b/horusmapper.py index d1d9716..e7270d3 100644 --- a/horusmapper.py +++ b/horusmapper.py @@ -711,6 +711,7 @@ def clear_bearing_data(data): global bearing_store logging.warning("Client requested bearing data be cleared.") bearing_store.flush() + flask_emit_event("server_bearings_cleared", {"foo":"bar"}) @socketio.on("mark_recovered", namespace="/chasemapper") diff --git a/static/js/bearings.js b/static/js/bearings.js index 77bcb3a..7d5e307 100644 --- a/static/js/bearings.js +++ b/static/js/bearings.js @@ -329,7 +329,6 @@ function flushBearings(){ var _confirm = confirm("Really clear all Bearing data?"); if (_confirm == true){ socket.emit('bearing_store_clear', {data: 'plzkthx'}); - destroyAllBearings(); } diff --git a/templates/index.html b/templates/index.html index d8e95c6..19fcdc1 100644 --- a/templates/index.html +++ b/templates/index.html @@ -555,6 +555,10 @@ bearingUpdate(data); }); + socket.on('server_bearings_cleared', function(data){ + destroyAllBearings(); + }); + $("#downloadModel").click(function(){ socket.emit('download_model', {data: 'plzkthx'});