Reuse jQuery selector where possible
This commit is contained in:

committed by
Sebastian Serth

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