anchor.diff:    var alertText = dh.attr('data-unsaved-work-text');
   
     ignoreUnsavedWorkAlert = false;
  -  if ( ignoreUnsavedWorkAlert ) {
  -    return;
  -  }
   
     $(window).on("beforeunload", function() {
       $(window).off('beforeunload');
  
positive.code:         .on("ajax:success", function(e, xhr, opts, data) {
            if (data.status == 200) {
              // Redirect back to index
              ignoreUnsavedWorkAlert = true;
              $(location).attr("href", xhr.url);
            }
          })
  
negative.code: 
    $(document).on("page:before-change", function() {
      var exit;
      if (ignoreUnsavedWorkAlert) {
        console.log('TRUE');
        exit = true;
      } else {
        console.log('FALSE');
        exit = confirm(alertText);
      }
      if ( exit ) {
        // We leave the page so remove all listeners
        $(window).off('beforeunload');
  