$(document).ready(function (e) { var filterList; $.expr[':'].Contains = function (a, i, m) { return (a.textContent || a.innerText || "").toUpperCase().indexOf(m[3].toUpperCase()) >= 0; }; filterList = function (list) { var form, input; form = $('.navbar-form'); input = $('.navbar-form input'); $(form).on('submit', function (event) { return event.preventDefault(); }); return $(input).change(function () { var $matches, filter; filter = $(this).val(); if (filter) { $matches = $(list).find('a ~ .sp-text:Contains(' + filter + ')').parent(); $('.sp-box', list).not($matches).hide(); $matches.show(); } else { $(list).find('.sp-box').show(); } return false; }).keyup(function () { return $(this).change(); }); }; $('.sp-box').on('click', function (e) { var content; content = $(this).html(); $('#InfoModal .modal-body').html(content); return $('#InfoModal').modal('show'); }); return $(document).ready(function (e) { return filterList($('.sheet')); }); });