0

I use BlockUI on every page unload/load

$(window).on('beforeunload', function() {
    $.blockUI();
});
$(window).on('unload', function() {
    $.unblockUI();
});

and Form Savior to prompt the user when leaving a page with unsaved form data

$(document).ready(function() {
    $("form").formSavior();
});

If the user opts to "Stay on Page" (as Firefox puts it), the UI remains blocked, and I can't see how to configure either plugin to avoid this (reordering the above statements doesn't help :-/)

I am willing to hack or adapt the (concise) Form Savior code, but can't see how to hook an unblockUI() to a cancellation.

NB my 1st question (or is that obvious?!)

cryogenyx
  • 211
  • 1
  • 5

1 Answers1

0

Use this answer: https://stackoverflow.com/a/9628365/1595293

Simple jQuery.ajax({}) before return value in 'beforeunload' event deal with blockUI problem.

Community
  • 1
  • 1
Luke Duda
  • 904
  • 9
  • 12