Leaving a page: a ticket's reply no longer asks Leave page first, as it is kept as a draft, and invoice, quote and recurring invoice notes save on the way out instead of asking; the document editor, signature and settings pages still ask

This commit is contained in:
johnnyq
2026-11-19 23:26:02 -05:00
parent 6a5bc6cf55
commit 3d2bfbcad5
4 changed files with 25 additions and 9 deletions

View File

@@ -67,7 +67,6 @@
itflowPost('ajax.php', { ticket_reply_draft: 1, csrf_token: csrf, ticket_id: ticketId, html: html }, function (answer) {
lastSaved = html;
var ed = editor();
// Kept, so leaving the page loses nothing - no need to warn about it
if (ed && content() === html) {
ed.setDirty(false);
}
@@ -103,6 +102,12 @@
}
if (drafts) {
// What is typed is kept as it goes and as the page is left, so leaving doesn't ask first (js/app.js)
var replyBox = document.getElementById('ticket_reply');
if (replyBox) {
replyBox.dataset.draftKept = '1';
}
var tries = 0;
(function waitForEditor() {
if (watchEditor()) {