mirror of https://github.com/keeweb/keeweb.git
fix #389: minimize instead of close, after changes are saved
This commit is contained in:
parent
a862919824
commit
10fde76499
|
@ -291,10 +291,17 @@ var AppView = Backbone.View.extend({
|
|||
return;
|
||||
}
|
||||
if (this.model.files.hasDirtyFiles()) {
|
||||
let exit = () => {
|
||||
if (this.model.settings.get('minimizeOnClose')) {
|
||||
Launcher.minimizeApp();
|
||||
} else {
|
||||
Launcher.exit();
|
||||
}
|
||||
};
|
||||
if (Launcher && !Launcher.exitRequested) {
|
||||
if (!this.exitAlertShown) {
|
||||
if (this.model.settings.get('autoSave')) {
|
||||
this.saveAndExit();
|
||||
this.saveAndLock(result => { if (result) { exit(); } });
|
||||
return Launcher.preventExit(e);
|
||||
}
|
||||
this.exitAlertShown = true;
|
||||
|
@ -308,9 +315,9 @@ var AppView = Backbone.View.extend({
|
|||
],
|
||||
success: result => {
|
||||
if (result === 'save') {
|
||||
this.saveAndExit();
|
||||
this.saveAndLock(result => { if (result) { exit(); } });
|
||||
} else {
|
||||
Launcher.exit();
|
||||
exit();
|
||||
}
|
||||
},
|
||||
cancel: () => {
|
||||
|
@ -452,14 +459,6 @@ var AppView = Backbone.View.extend({
|
|||
}
|
||||
},
|
||||
|
||||
saveAndExit: function() {
|
||||
this.saveAndLock(result => {
|
||||
if (result) {
|
||||
Launcher.exit();
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
closeAllFilesAndShowFirst: function() {
|
||||
var fileToShow = this.model.files.find(file => !file.get('demo') && !file.get('created'));
|
||||
this.model.closeAllFiles();
|
||||
|
|
Loading…
Reference in New Issue