diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-04-17 18:12:42 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-04-17 18:12:42 +0100 |
commit | 0a7f56d9dc36f22659bf786d15c3d7c4b8f33366 (patch) | |
tree | 28038498e1adc02d0ed234bd1a02b30798f654ab /web | |
parent | 25913d52079b80a29bf2c569b2cc103e58b417ac (diff) |
Don't hide bit of form if there's data in it.
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index 54e725864..fe2d1a496 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -230,10 +230,15 @@ $(function(){ /* * Show stuff on input focus */ - $('.form-focus-hidden').hide(); - $('.form-focus-trigger').on('focus', function(){ - $('.form-focus-hidden').fadeIn(500); - }); + var form_focus_data = $('.form-focus-trigger').map(function() { + return $(this).val(); + }).get().join(''); + if (!form_focus_data) { + $('.form-focus-hidden').hide(); + $('.form-focus-trigger').on('focus', function(){ + $('.form-focus-hidden').fadeIn(500); + }); + } /* * Show on click - pretty generic |