diff options
author | Dave Whiteland <dave@mysociety.org> | 2013-08-14 19:14:11 +0100 |
---|---|---|
committer | Dave Whiteland <dave@mysociety.org> | 2013-09-05 17:31:07 +0100 |
commit | 86a366703507d965622a059c56588aeb1a72bc47 (patch) | |
tree | f517ebb78f61defca16959ec79ce850442b60999 /web/js | |
parent | 704bce1c5858ecd1e0bf810a2ea14ad6067a55db (diff) |
jslint fixes
Diffstat (limited to 'web/js')
-rw-r--r-- | web/js/fixmystreet-admin.js | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/web/js/fixmystreet-admin.js b/web/js/fixmystreet-admin.js index cd74522ec..64f73ebb7 100644 --- a/web/js/fixmystreet-admin.js +++ b/web/js/fixmystreet-admin.js @@ -3,25 +3,27 @@ $(function(){ // hide the open311_only section and reveal it only when send_method is relevant var $open311_only = $('.admin-open311-only'); - if ($open311_only) { - function hide_or_show_open311(hide_fast) { - var send_method = $('#send_method').val(); - var show_open311 = false; - if ($('#endpoint').val()) { - show_open311 = true; // always show the form if there is an endpoint value - } else if (send_method && send_method.toLowerCase() != 'email') { - show_open311 = true; - } - if (show_open311) { - $open311_only.slideDown(); + + function hide_or_show_open311(hide_fast) { + var send_method = $('#send_method').val(); + var show_open311 = false; + if ($('#endpoint').val()) { + show_open311 = true; // always show the form if there is an endpoint value + } else if (send_method && send_method.toLowerCase() != 'email') { + show_open311 = true; + } + if (show_open311) { + $open311_only.slideDown(); + } else { + if (hide_fast) { + $open311_only.hide(); } else { - if (hide_fast) { - $open311_only.hide(); - } else { - $open311_only.slideUp(); - } + $open311_only.slideUp(); } } + } + + if ($open311_only) { $('#send_method').on('change', hide_or_show_open311); hide_or_show_open311(true); } @@ -51,7 +53,7 @@ $(function(){ $cols.show(); $(this).prop("value", 'Hide deleted contacts'); } - }) + }); } }); |