Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions assets/javascripts/time_logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ $(function() {
// Pass an jQuery selector that should be replaced with the response from server.
$(document).on('ajax:success', '[data-remote][data-replace]', function(event, data) {
var $this = $(this);

// As of Rails 5.1 and the new rails-ujs, the parameters data, status, xhr have been bundled into event.detail.
// For information about the previously used jquery-ujs in Rails 5 and earlier, read the jquery-ujs wiki.
if (typeof(data) === "undefined") {
data = event.detail[2].response;
}
$($this.data('replace')).html(data);
$this.trigger('ajax:replaced');
return true;
Expand Down