From 6e516ca31e10d51d4c4931620ccc706e6d43f085 Mon Sep 17 00:00:00 2001 From: Ralf Teusner Date: Thu, 1 Sep 2016 11:54:05 +0200 Subject: [PATCH] some minor fixes --- app/assets/javascripts/editor/flowr.js.erb | 4 ++-- app/assets/javascripts/editor/submissions.js.erb | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) 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 f752dde2..4b38f85d 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)); },