Skip to content

Instantly share code, notes, and snippets.

@PositiveControl
Created May 21, 2014 15:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PositiveControl/020c4ceda1bf5b147010 to your computer and use it in GitHub Desktop.
Save PositiveControl/020c4ceda1bf5b147010 to your computer and use it in GitHub Desktop.
JS + TurboLinks Bug Fix
/* Replaced first line with: $(document).on("page:update", function(){ */
$(document).ready(function(){
$('.filterable .btn-filter').click(function(){
var $panel = $(this).parents('.filterable'),
$filters = $panel.find('.filters input'),
$tbody = $panel.find('.table tbody');
if ($filters.prop('disabled') == true) {
$filters.prop('disabled', false);
$filters.first().focus();
} else {
$filters.val('').prop('disabled', true);
$tbody.find('.no-result').remove();
$tbody.find('tr').show();
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment