Merge remote-tracking branch 'origin/master' into 4084-log-pane-refresh
[arvados.git] / apps / workbench / app / assets / javascripts / application.js
index 39e8cf96eac5b9e8cfbb886451931f45eb545bac..a23a6d488045be7bc297aa217626e9d60cf23c02 100644 (file)
@@ -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,25 @@ 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');
+}