diff --git a/app/assets/javascripts/editor/editor.js.erb b/app/assets/javascripts/editor/editor.js.erb index 829f1d5a..8b3db444 100644 --- a/app/assets/javascripts/editor/editor.js.erb +++ b/app/assets/javascripts/editor/editor.js.erb @@ -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); diff --git a/app/assets/javascripts/editor/participantsupport.js.erb b/app/assets/javascripts/editor/participantsupport.js.erb index 1329cef2..5ea4cc9e 100644 --- a/app/assets/javascripts/editor/participantsupport.js.erb +++ b/app/assets/javascripts/editor/participantsupport.js.erb @@ -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'); diff --git a/app/views/exercises/_request_comment_dialogcontent.html.slim b/app/views/exercises/_request_comment_dialogcontent.html.slim index 4fc34dcd..677ccb12 100644 --- a/app/views/exercises/_request_comment_dialogcontent.html.slim +++ b/app/views/exercises/_request_comment_dialogcontent.html.slim @@ -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') \ No newline at end of file +/ 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') \ No newline at end of file