Browse Source

DIV-323 - progress spinner / back-button issue

pull/160/head
Mike Olund 8 years ago
parent
commit
40f0304aff
1 changed files with 11 additions and 6 deletions
  1. +11
    -6
      edivorce/apps/core/static/js/main.js

+ 11
- 6
edivorce/apps/core/static/js/main.js View File

@ -95,9 +95,14 @@ $(function () {
}); });
// spinner // spinner
$('input.spinner, a.spinner').on('click', function () {
$('a.spinner').on('click', function (e) {
e.preventDefault();
var href = $(this).attr('href');
$('div#progress-overlay').show(); $('div#progress-overlay').show();
$('div#progress-overlay-spinner').spin('large'); $('div#progress-overlay-spinner').spin('large');
setTimeout(function(){
window.location.href = href;
}, 0);
}); });
$('a.save-spinner').on('click', function (e) { $('a.save-spinner').on('click', function (e) {
@ -114,6 +119,11 @@ $(function () {
}); });
// kills the spinner when the back button is pressed
$(window).on('beforeunload', function () {
$('div#progress-overlay').hide();
$('div#progress-overlay-spinner').spin(false);
});
}); });
// delete and added field and save the change // delete and added field and save the change
@ -197,8 +207,3 @@ $('.no-collapse').on('click', function (e) {
e.stopPropagation(); e.stopPropagation();
}); });
// kills the spinner when the back button is pressed
window.onunload = function () {
$('div#progress-overlay').hide();
$('div#progress-overlay-spinner').spin(false);
};

Loading…
Cancel
Save