Update Turbolinks, load additional assets only on request, fix JS
Signed-off-by: Sebastian Serth <Sebastian.Serth@student.hpi.de>
This commit is contained in:
16
app/assets/javascripts/editor/ajax.js
Normal file
16
app/assets/javascripts/editor/ajax.js
Normal file
@ -0,0 +1,16 @@
|
||||
CodeOceanEditorAJAX = {
|
||||
ajax: function(options) {
|
||||
return $.ajax(_.extend({
|
||||
dataType: 'json',
|
||||
method: 'POST',
|
||||
}, options));
|
||||
},
|
||||
|
||||
ajaxError: function(response) {
|
||||
var message = ((response || {}).responseJSON || {}).message || '';
|
||||
|
||||
$.flash.danger({
|
||||
text: message.length > 0 ? message : $('#flash').data('message-failure')
|
||||
});
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user