diff --git a/resources/report/js/script.js b/resources/report/js/script.js index 26c3d615..8bccdf5a 100644 --- a/resources/report/js/script.js +++ b/resources/report/js/script.js @@ -885,6 +885,10 @@ function handleEditorClose(evt) { delete evt.target.data.editor; } }).catch(processCefError); + } else { + /* Don't need to record changes, but still need to notify C++ side that + the editor has been closed. */ + loot.query('editorClosed').catch(processCefError); } /* Now hide editor. */ diff --git a/src/gui/handler.cpp b/src/gui/handler.cpp index 72d0d92d..1117b14d 100644 --- a/src/gui/handler.cpp +++ b/src/gui/handler.cpp @@ -176,6 +176,14 @@ namespace loot { callback->Success(""); return true; } + else if (request == "editorClosed") { + // This version of the editorClosed query has no arguments as it is + // sent when editing is cancelled. Just update the unapplied changes + // counter. + --g_app_state.numUnappliedChanges; + callback->Success(""); + return true; + } else { // May be a request with arguments. YAML::Node req;