Upgrade font-awesome and add option reset only active file
This commit is contained in:
@@ -57,6 +57,13 @@ configureEditors: function () {
|
||||
}
|
||||
},
|
||||
|
||||
confirmResetActiveFile: function (event) {
|
||||
event.preventDefault();
|
||||
if (confirm($('#start-over-active-file').data('message-confirm'))) {
|
||||
this.resetCode(true); // delete only active file
|
||||
}
|
||||
},
|
||||
|
||||
fileActionsAvailable: function () {
|
||||
return this.isActiveFileRenderable() || this.isActiveFileRunnable() || this.isActiveFileStoppable() || this.isActiveFileTestable();
|
||||
},
|
||||
@@ -361,6 +368,9 @@ configureEditors: function () {
|
||||
$('#save').on('click', this.saveCode.bind(this));
|
||||
$('#start-over').on('click', this.confirmReset.bind(this));
|
||||
$('#start-over-collapsed').on('click', this.confirmReset.bind(this));
|
||||
$('#start-over-active-file').on('click', this.confirmResetActiveFile.bind(this));
|
||||
$('#start-over-active-file-collapsed').on('click', this.confirmResetActiveFile.bind(this));
|
||||
|
||||
},
|
||||
|
||||
initializeRequestForComments: function () {
|
||||
|
@@ -102,7 +102,7 @@ CodeOceanEditorSubmissions = {
|
||||
});
|
||||
},
|
||||
|
||||
resetCode: function() {
|
||||
resetCode: function(onlyActiveFile = false) {
|
||||
this.showSpinner(this);
|
||||
this.ajax({
|
||||
method: 'GET',
|
||||
@@ -114,7 +114,7 @@ CodeOceanEditorSubmissions = {
|
||||
var file = _.find(response.files, function(file) {
|
||||
return file.id === file_id;
|
||||
});
|
||||
if(file){
|
||||
if(file && !onlyActiveFile || file && file.id === CodeOceanEditor.active_file.id){
|
||||
editor.setValue(file.content);
|
||||
}
|
||||
}.bind(this));
|
||||
|
Reference in New Issue
Block a user