I"å (function() { var filter_table_rows; window.DfmWeb = {}; filter_table_rows = function(searched) { return $('.live_table > tbody > tr').show().filter(function() { var text; text = $(this).text(); return !~text.indexOf(searched); }).hide(); }; DfmWeb.activate_dfm_web = function() { $('.tablesorter').tablesorter({ widgets: ['zebra'] }); $('#notice, #alert').click(function() { $(this).stop(true); return $(this).slideUp('slow'); }); $(document).keyup(function(e) { if (e.keyCode === 27) { $('#notice, #alert').stop(true); return $('#notice, #alert').slideUp('slow'); } }); $(".ajax_load").each(function() { var data_path, data_target; data_target = $(this); data_path = data_target.data('path'); return $.get(data_path, function(response, status, xhr) { if (status === 'success' && response.length < 2048) { return data_target.html(response); } else { console.log("failed to load " + data_path); return false; } }); }); if (typeof datepicker !== "undefined") { $('.datepicker').datepicker({ dateFormat: "yy-mm-dd" }); } filter_table_rows($('#live_search').val()); $('#live_search').keyup(function() { return filter_table_rows($(this).val()); }); $(".auto_submit").change(function() { if (this.form.hasAttribute("data-remote")) { return $(this).submit(); } else { return this.form.submit(); } }); setTimeout((function() { return $('.autofocus').focus(); }), 0); /* NAV BAR */ if ($('#nav ul.right li').length > 1) { $('ul.right').after('
'); $('ul.right').addClass('has_hamburger'); } $('nav #hamburger').click(function() { return $("nav #nav ul.has_hamburger").toggle(); }); window.onresize = function() { if (window.innerWidth > 1023) { return $("nav #nav ul.has_hamburger").css('display', 'inline-block'); } else { return $("nav #nav ul.has_hamburger").css('display', 'none'); } }; $('main').click(function() { if (window.innerWidth <= 1023) { return $("nav #nav ul.has_hamburger").css('display', 'none'); } }); return $("#nav > ul > li > ul").each(function() { if ($(this).children('li').length > 10) { return $(this).addClass('crowded'); } }); }; }).call(this); :ET