diff --git a/frontend_tests/node_tests/dispatch.js b/frontend_tests/node_tests/dispatch.js index 0e3c14d237..2b689e37c0 100644 --- a/frontend_tests/node_tests/dispatch.js +++ b/frontend_tests/node_tests/dispatch.js @@ -60,6 +60,7 @@ set_global('settings_exports', { populate_exports_table: function (exports) { return exports; }, + clear_success_banner: noop, }); // page_params is highly coupled to dispatching now diff --git a/static/js/server_events_dispatch.js b/static/js/server_events_dispatch.js index 45eecf4760..9859dc14e6 100644 --- a/static/js/server_events_dispatch.js +++ b/static/js/server_events_dispatch.js @@ -512,6 +512,7 @@ exports.dispatch_normal_event = function dispatch_normal_event(event) { break; case 'realm_export': settings_exports.populate_exports_table(event.exports); + settings_exports.clear_success_banner(); break; } diff --git a/static/js/settings_exports.js b/static/js/settings_exports.js index 66fa7b139c..5a778eb0b8 100644 --- a/static/js/settings_exports.js +++ b/static/js/settings_exports.js @@ -12,6 +12,18 @@ exports.reset = function () { meta.loaded = false; }; +exports.clear_success_banner = function () { + var export_status = $('#export_status'); + if (export_status.hasClass('alert-success')) { + // Politely remove our success banner if the export + // finishes before the view is closed. + export_status.fadeTo(200, 0); + setTimeout(function () { + export_status.hide(); + }, 205); + } +}; + exports.populate_exports_table = function (exports) { if (!meta.loaded) { return;