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')
|
url: $('#editor').data('errors-url')
|
||||||
});
|
});
|
||||||
jqxhr.always(this.hideSpinner);
|
jqxhr.always(this.hideSpinner);
|
||||||
jqxhr.success(this.renderHint);
|
jqxhr.done(this.renderHint);
|
||||||
},
|
},
|
||||||
|
|
||||||
toggleButtonStates: function () {
|
toggleButtonStates: function () {
|
||||||
|
@ -83,7 +83,7 @@ CodeOceanEditorRequestForComments = {
|
|||||||
$.flash.success({text: $('#askForCommentsButton').data('message-success')});
|
$.flash.success({text: $('#askForCommentsButton').data('message-success')});
|
||||||
// trigger a run
|
// trigger a run
|
||||||
this.runSubmission.call(this, submission);
|
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));
|
this.createSubmission($('#requestComments'), null, createRequestForComments.bind(this));
|
||||||
|
@ -106,7 +106,7 @@ CodeOceanEditorSubmissions = {
|
|||||||
this.ajax({
|
this.ajax({
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: $('#start-over').data('url')
|
url: $('#start-over').data('url')
|
||||||
}).success(function(response) {
|
}).done(function(response) {
|
||||||
this.hideSpinner();
|
this.hideSpinner();
|
||||||
_.each(this.editors, function(editor) {
|
_.each(this.editors, function(editor) {
|
||||||
var file_id = $(editor.container).data('file-id');
|
var file_id = $(editor.container).data('file-id');
|
||||||
|
@ -8,9 +8,9 @@ $(document).on('turbolinks:load', function() {
|
|||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
error_template_attribute_id: $('#add-attribute').find('select').val()
|
error_template_attribute_id: $('#add-attribute').find('select').val()
|
||||||
}
|
}
|
||||||
}).success(function () {
|
}).done(function () {
|
||||||
location.reload();
|
location.reload();
|
||||||
}).error(function (error) {
|
}).fail(function (error) {
|
||||||
$.flash.danger({text: error.statusText});
|
$.flash.danger({text: error.statusText});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user