Merge pull request #234 from openHPI/fix_jquery
Migrate jQuery function use for ajax in case of success or failure
This commit is contained in:
@ -436,7 +436,7 @@ configureEditors: function () {
|
||||
url: $('#editor').data('errors-url')
|
||||
});
|
||||
jqxhr.always(this.hideSpinner);
|
||||
jqxhr.success(this.renderHint);
|
||||
jqxhr.done(this.renderHint);
|
||||
},
|
||||
|
||||
toggleButtonStates: function () {
|
||||
|
@ -83,7 +83,7 @@ CodeOceanEditorRequestForComments = {
|
||||
$.flash.success({text: $('#askForCommentsButton').data('message-success')});
|
||||
// trigger a run
|
||||
this.runSubmission.call(this, submission);
|
||||
}.bind(this)).error(this.ajaxError.bind(this));
|
||||
}.bind(this)).fail(this.ajaxError.bind(this));
|
||||
};
|
||||
|
||||
this.createSubmission($('#requestComments'), null, createRequestForComments.bind(this));
|
||||
|
@ -106,7 +106,7 @@ CodeOceanEditorSubmissions = {
|
||||
this.ajax({
|
||||
method: 'GET',
|
||||
url: $('#start-over').data('url')
|
||||
}).success(function(response) {
|
||||
}).done(function(response) {
|
||||
this.hideSpinner();
|
||||
_.each(this.editors, function(editor) {
|
||||
var file_id = $(editor.container).data('file-id');
|
||||
|
@ -8,9 +8,9 @@ $(document).on('turbolinks:load', function() {
|
||||
dataType: 'json',
|
||||
error_template_attribute_id: $('#add-attribute').find('select').val()
|
||||
}
|
||||
}).success(function () {
|
||||
}).done(function () {
|
||||
location.reload();
|
||||
}).error(function (error) {
|
||||
}).fail(function (error) {
|
||||
$.flash.danger({text: error.statusText});
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user