Update "last saved at" label after all types of submissions, not only autosaves

This commit is contained in:
Maximilian Grundke
2017-08-13 16:24:03 +02:00
parent 9592b5c939
commit 653aefa2c7

View File

@ -75,6 +75,8 @@ CodeOceanEditorSubmissions = {
}
// toggle button states (it might be the case that the request for comments button has to be enabled
this.toggleButtonStates();
this.updateSaveStateLabel();
},
/**
@ -200,12 +202,15 @@ CodeOceanEditorSubmissions = {
}
},
autosave: function () {
updateSaveStateLabel: function() {
var date = new Date();
var autosaveLabel = $(this.autosaveLabel);
autosaveLabel.parent().css("visibility", "visible");
autosaveLabel.text(date.getHours() + ':' + date.getMinutes() + ':' + date.getSeconds());
autosaveLabel.text(date.toLocaleTimeString());
},
autosave: function () {
this.autosaveTimer = null;
this.createSubmission($('#autosave'), null);
}