From: Coleman Watts Date: Fri, 12 Jun 2015 21:51:11 +0000 (-0400) Subject: CRM-16310 - Sortable table refinements X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=667f02170fe5ea5f5937ae08d0f964ee71647804;p=civicrm-core.git CRM-16310 - Sortable table refinements --- diff --git a/templates/CRM/Custom/Page/Option.tpl b/templates/CRM/Custom/Page/Option.tpl index 32a31ff1d7..befad67b41 100644 --- a/templates/CRM/Custom/Page/Option.tpl +++ b/templates/CRM/Custom/Page/Option.tpl @@ -99,8 +99,8 @@ var id = $('td:last', nRow).text().split(',')[0]; var cl = $('td:last', nRow).text().split(',')[1]; $(nRow).addClass(cl).attr({id: 'OptionValue-' + id}); - $('td:eq(0)', nRow).wrapInner('
'); - $('td:eq(0)', nRow).prepend('
'); + $('td:eq(0)', nRow).wrapInner('
'); + $('td:eq(0)', nRow).prepend('
'); $('td:eq(2)', nRow).addClass('crmf-default_value'); return nRow; }, @@ -127,7 +127,7 @@ var gid = {/literal}'{$optionGroupID}'{literal}; $("table.crm-option-selector tbody").sortable({ - handle: ".ui-icon-grip-dotted-vertical", + handle: ".ui-icon-arrowthick-2-n-s", cursor: "move", start:function(event, ui) { var oSettings = $('table.crm-option-selector').dataTable().fnSettings(); @@ -139,15 +139,16 @@ var index = oSettings._iDisplayStart; endPosition = index + ui.item.prevAll().length + 1; - $.getJSON(CRM.url('civicrm/ajax/reorder'), { + CRM.status({}, $.getJSON(CRM.url('civicrm/ajax/reorder'), { returnFormat:'JSON', start:startPosition, end: endPosition, gid: gid - }) + })) .success(function() { - oSettings.oApi._fnDraw(oSettings); - CRM.status(ts('Saved')); + $("table.crm-option-selector tbody tr").each(function(i) { + $(this).removeClass('odd even').addClass(i % 2 ? 'even' : 'odd'); + }); }); } });