X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/195b1b9f5b683110b4cef2ebd4e7cc3401317334..07ad3d1e604624893a945d08666046cc69568dab:/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..796053b8cd 100644 --- a/apps/workbench/app/assets/javascripts/application.js +++ b/apps/workbench/app/assets/javascripts/application.js @@ -21,7 +21,11 @@ //= require bootstrap/modal //= require bootstrap/button //= require bootstrap3-editable/bootstrap-editable +//= require bootstrap-tab-history //= require wiselinks +//= require raphael +//= require morris +//= require jquery.number.min //= require_tree . jQuery(function($){ @@ -213,4 +217,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); +}