Commit | Line | Data |
---|---|---|
3154780c CW |
1 | // http://civicrm.org/licensing |
2 | CRM.$(function($) { | |
3 | $('body') | |
4 | .off('.crmExpandRow') | |
5 | .on('click.crmExpandRow', 'a.crm-expand-row', function(e) { | |
6 | var $row = $(this).closest('tr'); | |
7 | if ($(this).hasClass('expanded')) { | |
8 | $row.next('.crm-child-row').remove(); | |
9 | } else { | |
10 | var count = $('td', $row).length, | |
11 | $newRow = $('<tr class="crm-child-row"><td colspan="' + count + '"></td></tr>') | |
12 | .insertAfter($row); | |
13 | CRM.loadPage(this.href, {target: $('td', $newRow.animate({height: '3em'}, 'fast'))}); | |
14 | } | |
15 | $(this).toggleClass('expanded'); | |
16 | e.preventDefault(); | |
17 | }); | |
18 | }); |