Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Prompt the user before they navigate away and lose their data

  • Loading branch information...
commit 5228e8e833847648e51b1698909b26b17a10acd6 1 parent d434498
@rictic rictic authored
Showing with 7 additions and 1 deletion.
  1. +6 −1 recon.html
  2. +1 −0  recon.js
View
7 recon.html
@@ -310,7 +310,7 @@ <h5 class='subheading'>(items which have the exact same name are faded out)</h5>
tabs.tabs("select", 0);
spreadsheetParsed(beginAutoReconciliation);
}
-
+ var reconciliationBegun = false;
$(document).ready(function() {
jQuery.ajaxSettings.cache = true; //keeps jquery from inserting cache-busting timecodes into json requests
@@ -327,6 +327,11 @@ <h5 class='subheading'>(items which have the exact same name are faded out)</h5>
if (window.location.hash != "")
window.location.hash = ""
$.historyInit(displayReconChoices);
+ window.onbeforeunload = function() {
+ if (reconciliationBegun)
+ return "You may have unsaved changes. Make sure to copy your updated spreadsheet or upload your data to Freebase on the Retrieve Your Data tab.";
+ };
+
});
function updateUnreconciledCount() {
View
1  recon.js
@@ -37,6 +37,7 @@ function beginAutoReconciliation() {
$(".nowReconciling").show();
$(".notReconciling").hide();
$("#gettingInput").remove();
+ reconciliationBegun = true;
autoReconcile();
}
Please sign in to comment.
Something went wrong with that request. Please try again.