mirror of
https://github.com/xevidos/codiad.git
synced 2024-11-10 21:26:35 +01:00
Updated autosave to save one second after last change so no changes are missed by the save function.
This commit is contained in:
parent
819408c0f5
commit
707b61ea6e
@ -33,6 +33,7 @@
|
||||
|
||||
// Allows relative `this.path` linkage
|
||||
auto_save_trigger: null,
|
||||
change: null,
|
||||
content: null,
|
||||
editor: null,
|
||||
invalid_states: [ "", " ", null, undefined ],
|
||||
@ -113,7 +114,7 @@
|
||||
|
||||
_this.editor = codiad.editor.getActive();
|
||||
_this.content = codiad.editor.getContent();
|
||||
_this.editor.addEventListener( "change", _this.auto_save );
|
||||
_this.change = _this.editor.addEventListener( "change", _this.auto_save );
|
||||
});
|
||||
},
|
||||
|
||||
@ -199,6 +200,13 @@
|
||||
}
|
||||
}
|
||||
_this.saving = false;
|
||||
|
||||
setTimeout(function() {
|
||||
|
||||
//Call the function again after one second so that if we missed the last change we resave the file.
|
||||
let _this = codiad.auto_save;
|
||||
_this.auto_save();
|
||||
}, 1000);
|
||||
},
|
||||
|
||||
reload_interval: async function() {
|
||||
|
Loading…
Reference in New Issue
Block a user