mirror of
https://github.com/xevidos/codiad.git
synced 2024-11-13 07:11:14 +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
1 changed files with 9 additions and 1 deletions
|
@ -33,6 +33,7 @@
|
||||||
|
|
||||||
// Allows relative `this.path` linkage
|
// Allows relative `this.path` linkage
|
||||||
auto_save_trigger: null,
|
auto_save_trigger: null,
|
||||||
|
change: null,
|
||||||
content: null,
|
content: null,
|
||||||
editor: null,
|
editor: null,
|
||||||
invalid_states: [ "", " ", null, undefined ],
|
invalid_states: [ "", " ", null, undefined ],
|
||||||
|
@ -113,7 +114,7 @@
|
||||||
|
|
||||||
_this.editor = codiad.editor.getActive();
|
_this.editor = codiad.editor.getActive();
|
||||||
_this.content = codiad.editor.getContent();
|
_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;
|
_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() {
|
reload_interval: async function() {
|
||||||
|
|
Loading…
Reference in a new issue