diff --git a/app/assets/javascripts/editor/flowr.js.erb b/app/assets/javascripts/editor/flowr.js.erb index 6440a0b5..30b4b298 100644 --- a/app/assets/javascripts/editor/flowr.js.erb +++ b/app/assets/javascripts/editor/flowr.js.erb @@ -53,10 +53,10 @@ CodeOceanEditorFlowr = { }).done(function () { this.hideSpinner(); $.flash.success({text: $('#askForCommentsButton').data('message-success')}); - }).error(this.ajaxError); + }.bind(this)).error(this.ajaxError.bind(this)); }; - this.createSubmission($('.requestCommentsButton'), null, createRequestForComments); + this.createSubmission($('.requestCommentsButton'), null, createRequestForComments.bind(this)); $('#comment-modal').modal('hide'); var button = $('.requestCommentsButton'); diff --git a/app/assets/javascripts/editor/submissions.js.erb b/app/assets/javascripts/editor/submissions.js.erb index 32557d8d..2c97cb5b 100644 --- a/app/assets/javascripts/editor/submissions.js.erb +++ b/app/assets/javascripts/editor/submissions.js.erb @@ -29,7 +29,10 @@ CodeOceanEditorSubmissions = { }); jqxhr.always(this.hideSpinner.bind(this)); jqxhr.done(this.createSubmissionCallback.bind(this)); - jqxhr.done(callback.bind(this)); + if(callback != null){ + jqxhr.done(callback.bind(this)); + } + jqxhr.fail(this.ajaxError.bind(this)); },