diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-06-16 17:11:30 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-06-16 17:11:30 -0700 |
commit | 9bee11036c3bf8e7905bbebf77a77792660186ac (patch) | |
tree | 4d317bc418853745ed7f933c3f288c3b0482321d /httemplate/edit/cust_main | |
parent | 925cf9600781e534b4188adb68cc53a9709a6569 (diff) |
UI spring cleaning: animate company/spouse/contact hide/unhide
Diffstat (limited to 'httemplate/edit/cust_main')
-rw-r--r-- | httemplate/edit/cust_main/basics.html | 18 | ||||
-rw-r--r-- | httemplate/edit/cust_main/company.html | 9 | ||||
-rw-r--r-- | 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; -<TR ID="company_row" <% $cust_main->company ? '' : 'STYLE="display:none"' %>> - <TH ALIGN="right"><% mt('Company') |h %></TD> - <TD COLSPAN=6><INPUT TYPE="text" NAME="company" ID="company" SIZE=60 +% my $style = $cust_main->company ? '' : 'STYLE="display:none"'; +<TR ID="company_row"> + <TH ALIGN="right"><DIV ID="company_label" <%$style%>><% mt('Company') |h %></DIV></TD> + <TD COLSPAN=6><DIV ID="company_input" <%$style%>><INPUT TYPE="text" NAME="company" ID="company" SIZE=60 VALUE="<% $cust_main->company |h %>"> - </TD> + </DIV></TD> </TR> 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) = @_; -<DIV STYLE="display: inline-block"> +<DIV STYLE="display: inline-block" ID="<% $field %>_input"> <INPUT TYPE="text" NAME="<% $field %>" VALUE="<% $value |h %>" <%$extra%>> <BR><FONT SIZE="-1" COLOR="#333333"><% mt($label) %></FONT> </DIV> @@ -21,7 +21,7 @@ </TR> % if ( $conf->exists('cust_main-enable_spouse') ) { <TR ID="spouse_row"> - <TH CLASS="label"><% mt('Spouse\'s name') |h %></TD> + <TH CLASS="label" ALIGN="right"><DIV ID="spouse_label"><% mt('Spouse\'s name') |h %></DIV></TD> <TD COLSPAN=6> <& .namepart, 'spouse_last', $cust_main->spouse_last, 'Last', ',' &> <& .namepart, 'spouse_first', $cust_main->spouse_first, 'First' &> |