From 9bee11036c3bf8e7905bbebf77a77792660186ac Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 16 Jun 2015 17:11:30 -0700 Subject: [PATCH] UI spring cleaning: animate company/spouse/contact hide/unhide --- httemplate/edit/cust_main/basics.html | 18 ++++++++++++------ httemplate/edit/cust_main/company.html | 9 +++++---- httemplate/edit/cust_main/name.html | 4 ++-- 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/httemplate/edit/cust_main/basics.html b/httemplate/edit/cust_main/basics.html index 2ca6f65a5..e484c732d 100644 --- a/httemplate/edit/cust_main/basics.html +++ b/httemplate/edit/cust_main/basics.html @@ -25,15 +25,21 @@ function rescom_changed(what) { if ( what.checked == (what.value == 'Commercial' ) ) { - document.getElementById('company_row').style.display = ''; - document.getElementById('contacts_div').style.display = ''; - document.getElementById('spouse_row').style.display = 'none'; + $('#company_label').slideDown(); + $('#company_input').slideDown(); + $('#contacts_div').slideDown(); + $('#spouse_label').slideUp(); + $('#spouse_last_input').slideUp(); + $('#spouse_first_input').slideUp(); } else { if ( document.getElementById('company').value.length == 0 ) { - document.getElementById('company_row').style.display = 'none'; + $('#company_label').slideUp(); + $('#company_input').slideUp(); } - document.getElementById('contacts_div').style.display = 'none'; - document.getElementById('spouse_row').style.display = ''; + $('#contacts_div').slideUp(); + $('#spouse_label').slideDown(); + $('#spouse_last_input').slideDown(); + $('#spouse_first_input').slideDown(); } } diff --git a/httemplate/edit/cust_main/company.html b/httemplate/edit/cust_main/company.html index 50c4f709b..3341d8011 100644 --- a/httemplate/edit/cust_main/company.html +++ b/httemplate/edit/cust_main/company.html @@ -1,7 +1,8 @@ % my $cust_main = shift; -company ? '' : 'STYLE="display:none"' %>> - <% mt('Company') |h %> - company ? '' : 'STYLE="display:none"'; + +
><% mt('Company') |h %>
+
> - +
diff --git a/httemplate/edit/cust_main/name.html b/httemplate/edit/cust_main/name.html index bc55801cf..13bd09764 100644 --- a/httemplate/edit/cust_main/name.html +++ b/httemplate/edit/cust_main/name.html @@ -1,6 +1,6 @@ <%def .namepart> % my ($field, $value, $label, $extra) = @_; -
+
>
<% mt($label) %>
@@ -21,7 +21,7 @@ % if ( $conf->exists('cust_main-enable_spouse') ) { - <% mt('Spouse\'s name') |h %> +
<% mt('Spouse\'s name') |h %>
<& .namepart, 'spouse_last', $cust_main->spouse_last, 'Last', ',' &> <& .namepart, 'spouse_first', $cust_main->spouse_first, 'First' &> -- 2.11.0