fix:confirmation on editor closing

- add variable definition on saving the file for confirmation question
- add editor focus after confirmation message
This commit is contained in:
thelastWallE 2021-10-02 22:58:27 +02:00
parent a38f76499c
commit f7ae941e9e
1 changed files with 4 additions and 0 deletions

View File

@ -56,6 +56,9 @@ $(function () {
var dialog = $("#klipper_editor");
dialog.modal('hide');
},
oncancel: function () {
self.editorFocusDelay(1000);
},
nofade: true
});
} else {
@ -133,6 +136,7 @@ $(function () {
OctoPrint.plugins.klipper.saveCfg(editor.session.getValue(), self.CfgFilename())
.done(function (response) {
var msg = ""
self.loadedConfig = editor.session.getValue();
if (response.saved === true) {
self.klipperViewModel.showPopUp("success", gettext("Save Config"), gettext("File saved."));
if (self.settings.settings.plugins.klipper.configuration.restart_onsave()==true) {