diff options
author | Matthew Somerville <matthew@mysociety.org> | 2016-08-23 17:16:51 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2016-08-23 17:24:21 +0100 |
commit | 2c15366893abcabc09b5b743199525412e5a2940 (patch) | |
tree | 2c5b4f22faaaf708d8e70f502a31fbb49360fba5 | |
parent | ec5e2c47f736c075e6dafd1ed63860287f596077 (diff) |
Fix updating email field when reporting as another
When the form is shown via JavaScript, we need the email box to start
off editable as it is if you hadn't used JavaScript, and we also need
the change() to be fired on the right field.
-rw-r--r-- | templates/web/base/report/new/form_user_loggedin.html | 2 | ||||
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/templates/web/base/report/new/form_user_loggedin.html b/templates/web/base/report/new/form_user_loggedin.html index 49ead784c..1f941a6d1 100644 --- a/templates/web/base/report/new/form_user_loggedin.html +++ b/templates/web/base/report/new/form_user_loggedin.html @@ -27,7 +27,7 @@ <label for="form_email">[% loc('Email address') %]</label> <input id="form_email" - [%- IF can_contribute_as_another_user OR can_contribute_as_body -%] + [%- IF js OR can_contribute_as_another_user OR can_contribute_as_body -%] name="email" [%- ELSE -%] disabled diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index 4302ed8ff..bc728e6ae 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -425,7 +425,8 @@ $.extend(fixmystreet.set_up, { $showNameCheckbox.prop('checked', true).prop('disabled', true); $addAlertCheckbox.prop('checked', false).prop('disabled', true); } - }).change(); + }); + $('.js-contribute-as').change(); }, on_resize: function() { |