X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/c446dd845656e944c2d3f91f8d00e320c37b66a1..1bb7352bf1425dc9acf028f863eaff1e5c207571:/apps/workbench/app/assets/javascripts/application.js diff --git a/apps/workbench/app/assets/javascripts/application.js b/apps/workbench/app/assets/javascripts/application.js index 39e8cf96ea..1990b8b0f5 100644 --- a/apps/workbench/app/assets/javascripts/application.js +++ b/apps/workbench/app/assets/javascripts/application.js @@ -21,6 +21,7 @@ //= require bootstrap/modal //= require bootstrap/button //= require bootstrap3-editable/bootstrap-editable +//= require bootstrap-tab-history //= require wiselinks //= require_tree . @@ -213,4 +214,29 @@ jQuery(function($){ $(e.target.href).collapse('toggle'); }); + $(document).on('click', '.force-cache-reload', function(e) { + history.replaceState( { nocache: true }, '' ); + }); +}); + +window.addEventListener("DOMContentLoaded", function(e) { + if(history.state) { + if(history.state.nocache) { + showLoadingModal(); + history.replaceState( {}, '' ); + location.reload(true); + } + } }); + +function showLoadingModal() { + $('#loading-modal').modal('show'); +} + +function hideLoadingModal() { + $('#loading-modal').modal('hide'); +} + +function hasHTML5History() { + return !!(window.history && window.history.pushState); +}