From 20b066e0dba169a1dce8dd8abe89ddbcd1b0f950 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 22 Jan 2015 10:30:51 -0500 Subject: [PATCH] CRM-15842 - Improve default of 'collapsed' checkbox --- templates/CRM/Custom/Form/Group.tpl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/templates/CRM/Custom/Form/Group.tpl b/templates/CRM/Custom/Form/Group.tpl index 7564379560..b7222b7487 100644 --- a/templates/CRM/Custom/Form/Group.tpl +++ b/templates/CRM/Custom/Form/Group.tpl @@ -95,6 +95,16 @@ CRM.$(function($) { } $('input#is_multiple').change(showRange); + // "Collapse" is a bad default for "Tab" display + $("select#style").change(function() { + if ($(this).val() == 'Tab') { + $('#collapse_display').prop('checked', false); + } + }); + + /** + * Check if this is a contact-related set and show/hide other options accordingly + */ function showHideStyle() { var extend = $(this).val(), @@ -130,6 +140,11 @@ CRM.$(function($) { } } + /** + * Check if this set supports multiple records and adjust other options accordingly + * + * @param onFormLoad + */ function showRange(onFormLoad) { if($("#is_multiple").is(':checked')) { $("tr#multiple_row").show(); @@ -149,7 +164,7 @@ CRM.$(function($) { } // In update mode, when 'extends' is set to an option which doesn't have - // any options in 2nd selector (for subtypes) - + // any options in 2nd selector (for subtypes) var subtypes = document.getElementById('extends_1'); if (subtypes) { if (subtypes.options.length <= 0) { -- 2.25.1