Skip to content
Snippets Groups Projects
Commit 9593cc99 authored by Jared Hancock's avatar Jared Hancock
Browse files

draft: Show alarming warning on failed auto-save

parent 490f39cd
No related branches found
No related tags found
No related merge requests found
......@@ -286,3 +286,17 @@ $(function() {
$(document).on('pjax:success', findRichtextBoxes);
$(document).on('pjax:start', cleanupRedactorElements);
});
$(document).ajaxError(function(event, request, settings) {
if (settings.url.indexOf('ajax.php/draft') != -1) {
$('.richtext').each(function() {
var redactor = $(this).data('redactor');
if (redactor) {
clearInterval(redactor.autosaveInterval);
}
});
$('#overlay').show();
alert('Unable to save draft. Refresh the current page to restore and continue your draft.');
$('#overlay').hide();
}
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment