Fix request for comments. Scope of the function call was incorrect, and the correct cause was not passed to the rails and the database afterwards. This is both fixed now.
This commit is contained in:
@ -319,7 +319,7 @@ configureEditors: function () {
|
||||
$('#comment-modal').modal('show');
|
||||
});
|
||||
|
||||
$('#askForCommentsButton').on('click', this.requestComments);
|
||||
$('#askForCommentsButton').on('click', this.requestComments.bind(this));
|
||||
|
||||
setTimeout(function () {
|
||||
button.prop('disabled', false);
|
||||
|
@ -84,7 +84,7 @@ CodeOceanEditorRequestForComments = {
|
||||
}.bind(this)).error(this.ajaxError.bind(this));
|
||||
};
|
||||
|
||||
this.createSubmission($('.requestCommentsButton'), null, createRequestForComments.bind(this));
|
||||
this.createSubmission($('#requestComments'), null, createRequestForComments.bind(this));
|
||||
|
||||
$('#comment-modal').modal('hide');
|
||||
var button = $('#requestComments');
|
||||
|
@ -1,4 +1,6 @@
|
||||
h5 = t('exercises.implement.comment.question')
|
||||
textarea.form-control#question(style='resize:none;')
|
||||
p = ''
|
||||
button#askForCommentsButton.btn.btn-block.btn-primary(type='button' data-message-success=t('exercises.editor.request_for_comments_sent')) =t('exercises.implement.comment.request')
|
||||
/ data-cause='requestComments' is not used here right now, we pass the button #requestComments (not askForCommentsButton) as initiator of the action.
|
||||
/ But if we use this button, it will work since the correct cause is supplied
|
||||
button#askForCommentsButton.btn.btn-block.btn-primary(type='button' data-cause='requestComments' data-message-success=t('exercises.editor.request_for_comments_sent')) =t('exercises.implement.comment.request')
|
Reference in New Issue
Block a user