Skip to content

Commit

Permalink
This closes metaminded#48
Browse files Browse the repository at this point in the history
  • Loading branch information
mlt committed Sep 28, 2017
1 parent 0b4daab commit e6993c2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ source 'https://rubygems.org'
gemspec

gem 'jquery-rails'
gem 'turbolinks'
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw]

group :development, :test do
Expand Down
8 changes: 4 additions & 4 deletions app/assets/javascripts/tabulatr/_events.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
$(function(){
tabulatr_tables = [];

$('th.tabulatr-sortable').click(function(){
$(document).on('click', 'th.tabulatr-sortable', function(){
var th = $(this);
var sort_by = th.data('tabulatr-column-name');
var dir = th.attr('data-sorted');
Expand Down Expand Up @@ -30,6 +27,8 @@ $(function(){
table_obj.updateTable({});
});

$(document).on('ready page:load turbolinks:load', function(){
tabulatr_tables = [];

$('.tabulatr_table').each(function(ix, el){
if($('.pagination[data-table="'+ $(el).attr('id') +'"]').length === 0){
Expand Down Expand Up @@ -223,6 +222,7 @@ $(function(){
$(document).on('click', 'a[data-show-filters-for]', function(){
var a = $(this);
a.parents('.tabulatr-outer-wrapper').addClass('filtered');
return false;
});

});
Expand Down
1 change: 1 addition & 0 deletions spec/dummy/app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
//= require jquery_ujs
//= require bootstrap
//= require tabulatr
//= require turbolinks
//= require_tree .

0 comments on commit e6993c2

Please sign in to comment.