Sha256: 410130a70f50594d7e4773447d82655496fa98da0cfdcc649f4cb3d9a031e8b2
Contents?: true
Size: 1.45 KB
Versions: 16
Compression:
Stored size: 1.45 KB
Contents
/*global Application */ ;(function($){ $.fn.collapsible = function() { var storage = Application.storage(); return this.each(function() { if (storage && storage.getItem(this.id) === 'collapsed') { $(this) .data('is_collapsed', true) .find('tbody').hide().end() .find('.arrow') .animate({ rotate: '90deg' }, 200, 'ease-out'); } $(this) .off('click', 'th') .on('click', 'th', function() { var $table = $(this).closest('table'); if ($table.data('is_collapsed')) { if (storage) storage.setItem($table.attr('id'), 'expanded'); $table .data('is_collapsed', false) .find('tbody').show().end() .find('.arrow') .animate({ rotate: '0' }, 200, 'ease-out'); } else { if (storage) storage.setItem($table.attr('id'), 'collapsed'); $table .data('is_collapsed', true) .find('tbody').hide().end() .find('.arrow') .animate({ rotate: '90deg' }, 200, 'ease-out'); } }); }); }; })(Zepto);
Version data entries
16 entries across 16 versions & 1 rubygems