Reuse jQuery selector where possible
This commit is contained in:

committed by
Sebastian Serth

parent
affeb2d3ba
commit
5b35ccdfe8
@ -108,13 +108,15 @@ CodeOceanEditorFlowr = {
|
||||
CodeOceanEditorRequestForComments = {
|
||||
requestComments: function () {
|
||||
const cause = $('#requestComments');
|
||||
const editor = $('#editor')
|
||||
const questionElement = $('#question')
|
||||
this.startSentryTransaction(cause);
|
||||
$('#question').prop("disabled", true);
|
||||
questionElement.prop("disabled", true);
|
||||
$('#closeAskForCommentsButton').addClass('d-none');
|
||||
|
||||
var exercise_id = $('#editor').data('exercise-id');
|
||||
var exercise_id = editor.data('exercise-id');
|
||||
var file_id = $('.editor').data('id');
|
||||
var question = $('#question').val();
|
||||
var question = questionElement.val();
|
||||
|
||||
var createRequestForComments = function (submission) {
|
||||
this.showSpinner($('#askForCommentsButton'));
|
||||
|
@ -163,7 +163,7 @@ CodeOceanEditorSubmissions = {
|
||||
this.startSentryTransaction(cause);
|
||||
event.preventDefault();
|
||||
this.stopCode(event);
|
||||
if ($('#run').is(':visible')) {
|
||||
if (cause.is(':visible')) {
|
||||
this.createSubmission(cause, null, this.runSubmission.bind(this));
|
||||
}
|
||||
},
|
||||
|
Reference in New Issue
Block a user