$(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) {
+ console.log('no cache!');
+ showLoadingModal();
+ history.replaceState( {}, '' );
+ location.reload(true);
+ }
+ }
+});
+
+function showLoadingModal() {
+ $('#loading-modal').modal('show');
+}
+
+function hideLoadingModal() {
+ $('#loading-modal').modal('hide');
+}
--- /dev/null
+<div id="loading-modal" class="modal fade">
+ <div class="modal-dialog">
+ <div class="modal-content">
+ <div class="modal-header">
+ <h3>Refreshing...</h3>
+ </div>
+ <div class="modal-body">
+ <p>Content may have changed.</p>
+ </div>
+ </div>
+ </div>
+</div>
selection_param: 'uuid',
success: 'redirect-to-created-object'
}.to_json),
- { class: "btn btn-sm btn-primary", remote: true, method: 'get' }) do %>
+ { class: "btn btn-sm btn-primary force-cache-reload", remote: true, method: 'get' }) do %>
<i class="fa fa-fw fa-truck"></i> Move to project...
<% end %>
<% end %>