diff --git a/app/assets/javascripts/editor/submissions.js.erb b/app/assets/javascripts/editor/submissions.js.erb index 467c2cd7..20d8cd10 100644 --- a/app/assets/javascripts/editor/submissions.js.erb +++ b/app/assets/javascripts/editor/submissions.js.erb @@ -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); }