Merge pull request #123 from openHPI/autosave-label-update

Update Save Label
This commit is contained in:
rteusner
2017-08-16 10:37:57 +02:00
committed by GitHub

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);
}