Fix #39
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:
parent
2fb3e9fea7
commit
45bd1f6ab4
4 changed files with 13 additions and 14 deletions
2
Gemfile
2
Gemfile
|
@ -99,7 +99,7 @@ gem 'high_voltage', '~> 3.1'
|
||||||
# Errors on errbit
|
# Errors on errbit
|
||||||
gem 'airbrake'
|
gem 'airbrake'
|
||||||
|
|
||||||
gem 'bootstrap-sass', '~> 3.3.5'
|
gem 'bootstrap-sass', ">= 3.4.1"
|
||||||
gem 'react-rails', '~> 1.10.0'
|
gem 'react-rails', '~> 1.10.0'
|
||||||
gem 'rolify'
|
gem 'rolify'
|
||||||
gem 'rails-controller-testing'
|
gem 'rails-controller-testing'
|
||||||
|
|
|
@ -61,9 +61,9 @@ GEM
|
||||||
bcrypt (3.1.13)
|
bcrypt (3.1.13)
|
||||||
bcrypt_pbkdf (1.0.1)
|
bcrypt_pbkdf (1.0.1)
|
||||||
bindex (0.8.1)
|
bindex (0.8.1)
|
||||||
bootstrap-sass (3.3.7)
|
bootstrap-sass (3.4.1)
|
||||||
autoprefixer-rails (>= 5.2.1)
|
autoprefixer-rails (>= 5.2.1)
|
||||||
sass (>= 3.3.4)
|
sassc (>= 2.0.0)
|
||||||
builder (3.2.3)
|
builder (3.2.3)
|
||||||
byebug (11.0.1)
|
byebug (11.0.1)
|
||||||
cancancan (3.0.1)
|
cancancan (3.0.1)
|
||||||
|
@ -291,6 +291,8 @@ GEM
|
||||||
sprockets (>= 2.8, < 4.0)
|
sprockets (>= 2.8, < 4.0)
|
||||||
sprockets-rails (>= 2.0, < 4.0)
|
sprockets-rails (>= 2.0, < 4.0)
|
||||||
tilt (>= 1.1, < 3)
|
tilt (>= 1.1, < 3)
|
||||||
|
sassc (2.1.0)
|
||||||
|
ffi (~> 1.9)
|
||||||
sdoc (0.4.2)
|
sdoc (0.4.2)
|
||||||
json (~> 1.7, >= 1.7.7)
|
json (~> 1.7, >= 1.7.7)
|
||||||
rdoc (~> 4.0)
|
rdoc (~> 4.0)
|
||||||
|
@ -346,7 +348,7 @@ DEPENDENCIES
|
||||||
airbrake
|
airbrake
|
||||||
annotate
|
annotate
|
||||||
bcrypt_pbkdf
|
bcrypt_pbkdf
|
||||||
bootstrap-sass (~> 3.3.5)
|
bootstrap-sass (>= 3.4.1)
|
||||||
byebug
|
byebug
|
||||||
cancancan
|
cancancan
|
||||||
capistrano (~> 3.1)
|
capistrano (~> 3.1)
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
//= require chartkick
|
//= require chartkick
|
||||||
//= require_tree .
|
//= require_tree .
|
||||||
|
|
||||||
ready = function() {
|
$(document).on('turbolinks:load', function() {
|
||||||
$.each($(".select2-selector"), function(index, val) {
|
$.each($(".select2-selector"), function(index, val) {
|
||||||
$(val).select2({
|
$(val).select2({
|
||||||
width: $(val).data('width'),
|
width: $(val).data('width'),
|
||||||
|
@ -34,7 +34,4 @@ ready = function() {
|
||||||
allowClear: true
|
allowClear: true
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
}
|
});
|
||||||
|
|
||||||
$(document).ready(ready)
|
|
||||||
$(document).on('page:load', ready)
|
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
ready = function() {
|
$(document).on('turbolinks:load', function() {
|
||||||
form = $("#new_transaction");
|
form = $("#new_transaction");
|
||||||
submit_button = $(form).find("input[type=submit]");
|
submit_button = $(form).find("input[type=submit]");
|
||||||
errors = $("#transaction_errors");
|
errors = $("#transaction_errors");
|
||||||
panel_ul = $(errors).find(".panel-body ul");
|
panel_ul = $(errors).find(".panel-body ul");
|
||||||
flash_success = $("#transaction_success");
|
flash_success = $("#transaction_success");
|
||||||
|
|
||||||
|
if ($("#users-transactions")[0]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var table = $('#transactions').DataTable({
|
var table = $('#transactions').DataTable({
|
||||||
processing: true,
|
processing: true,
|
||||||
serverSide: true,
|
serverSide: true,
|
||||||
|
@ -107,12 +110,9 @@ ready = function() {
|
||||||
$(submit_button).attr('disabled', false);
|
$(submit_button).attr('disabled', false);
|
||||||
table.ajax.reload();
|
table.ajax.reload();
|
||||||
});
|
});
|
||||||
}
|
});
|
||||||
|
|
||||||
|
|
||||||
$.ajaxSetup({
|
$.ajaxSetup({
|
||||||
dataType: 'text'
|
dataType: 'text'
|
||||||
});
|
});
|
||||||
|
|
||||||
$(document).ready(ready);
|
|
||||||
$(document).on('page:load', ready);
|
|
||||||
|
|
Loading…
Reference in a new issue