Reuse jQuery selector where possible

This commit is contained in:
Sebastian Serth
2023-12-22 00:45:44 +01:00
committed by Sebastian Serth
parent affeb2d3ba
commit 5b35ccdfe8
2 changed files with 6 additions and 4 deletions

View File

@ -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'));