This was caused by the javascript not loading: the turbolink event for
when a page is loaded has changed from 'page:load' to 'turbolinks:load'.
This commit is contained in:
redfast00 2019-08-24 21:08:11 +02:00
parent 2fb3e9fea7
commit 45bd1f6ab4
No known key found for this signature in database
GPG key ID: 5946E0E34FD0553C
4 changed files with 13 additions and 14 deletions

View file

@ -99,7 +99,7 @@ gem 'high_voltage', '~> 3.1'
# Errors on errbit
gem 'airbrake'
gem 'bootstrap-sass', '~> 3.3.5'
gem 'bootstrap-sass', ">= 3.4.1"
gem 'react-rails', '~> 1.10.0'
gem 'rolify'
gem 'rails-controller-testing'

View file

@ -61,9 +61,9 @@ GEM
bcrypt (3.1.13)
bcrypt_pbkdf (1.0.1)
bindex (0.8.1)
bootstrap-sass (3.3.7)
bootstrap-sass (3.4.1)
autoprefixer-rails (>= 5.2.1)
sass (>= 3.3.4)
sassc (>= 2.0.0)
builder (3.2.3)
byebug (11.0.1)
cancancan (3.0.1)
@ -291,6 +291,8 @@ GEM
sprockets (>= 2.8, < 4.0)
sprockets-rails (>= 2.0, < 4.0)
tilt (>= 1.1, < 3)
sassc (2.1.0)
ffi (~> 1.9)
sdoc (0.4.2)
json (~> 1.7, >= 1.7.7)
rdoc (~> 4.0)
@ -346,7 +348,7 @@ DEPENDENCIES
airbrake
annotate
bcrypt_pbkdf
bootstrap-sass (~> 3.3.5)
bootstrap-sass (>= 3.4.1)
byebug
cancancan
capistrano (~> 3.1)

View file

@ -26,7 +26,7 @@
//= require chartkick
//= require_tree .
ready = function() {
$(document).on('turbolinks:load', function() {
$.each($(".select2-selector"), function(index, val) {
$(val).select2({
width: $(val).data('width'),
@ -34,7 +34,4 @@ ready = function() {
allowClear: true
});
})
}
$(document).ready(ready)
$(document).on('page:load', ready)
});

View file

@ -1,10 +1,13 @@
ready = function() {
$(document).on('turbolinks:load', function() {
form = $("#new_transaction");
submit_button = $(form).find("input[type=submit]");
errors = $("#transaction_errors");
panel_ul = $(errors).find(".panel-body ul");
flash_success = $("#transaction_success");
if ($("#users-transactions")[0]) {
return;
}
var table = $('#transactions').DataTable({
processing: true,
serverSide: true,
@ -107,12 +110,9 @@ ready = function() {
$(submit_button).attr('disabled', false);
table.ajax.reload();
});
}
});
$.ajaxSetup({
dataType: 'text'
});
$(document).ready(ready);
$(document).on('page:load', ready);