Sha256: b98ca154315bea0888973bd96b6977a6aed4b6956ad48a4d49ff59dcff985434
Contents?: true
Size: 1.52 KB
Versions: 7
Compression:
Stored size: 1.52 KB
Contents
/** * @author Geoff */ (function() { $(document).ready(function () { $('input.slider[type="checkbox"]').change(function() { if ($(this).is(':checked')) { $($(this).data('slider')).slideDown(); } else { $($(this).data('slider')).slideUp(); } }).change(); if ($('.recent-rally[data-reload="true"]').size() > 0) { setTimeout(function() { reloadRallies(); }, 4000); } $('.reload').click(function() { reloadRallies(); }); var reloadRallies = function() { var rally_id = parseInt($('.recent-rally').data('rally-id')); var convert_id = $('.recent-rally').data('convert-id'); if (rally_id) { $.ajax({ url: '/mg/rallies/new', data: { 'recent_rally': rally_id, 'convert_id': convert_id }, success: function(json) { if (!json.success) { console.log('No new events'); } else { $('.recent-rally').data('rally-id', json.recent_rally_id); res = $(json.result); res.hide().prependTo($('.rally-list')).fadeIn(3000); $('ul.rally-list > li.rally:gt(100)').remove(); //only show 100 elements if ($('.rally-list abbr.time-ago').size() > 0) { $('.rally-list abbr.time-ago').timeago(); } } if ($('.recent-rally[data-reload="true"]').size() > 0) { setTimeout(function() { reloadRallies(); }, 4000); } } }); } }; if ($('abbr.time-ago').size() > 0) { $('abbr.time-ago').timeago(); } }); })();
Version data entries
7 entries across 7 versions & 1 rubygems