aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2017-01-27 11:55:43 +0000
committerDave Arter <davea@mysociety.org>2017-01-31 16:20:06 +0000
commit64e43ba8d5d4223cdd0eb29bea289201a490a4de (patch)
treeb90883ced4ababc4279187fb847a066d7de403b0
parent1328677512a870561c84ba57b9ac0dace993dc13 (diff)
Simplify response template selector HTML
Using a div inside a p isn't valid, so the DOM was being restructured by the browser causing the 'save with public update' toggle on the inspect form to not work. This fixes the issue by removing the wrapper <div> and selecting the appropriate elements for toggling with the js- class on the <select>. Fixes mysociety/fixmystreetforcouncils#153
-rw-r--r--templates/web/base/admin/response_templates_select.html2
-rw-r--r--web/cobrands/zurich/js.js4
2 files changed, 2 insertions, 4 deletions
diff --git a/templates/web/base/admin/response_templates_select.html b/templates/web/base/admin/response_templates_select.html
index e10460e48..ec50b2401 100644
--- a/templates/web/base/admin/response_templates_select.html
+++ b/templates/web/base/admin/response_templates_select.html
@@ -1,10 +1,8 @@
[% IF problem.response_templates %]
-<div class="response_templates_select">
<select id="templates_for_[% for %]" class="form-control js-template-name" data-for="[% for %]" name="response_template">
<option value="">[% loc('--Choose a template--') %]</option>
[% FOR t IN problem.response_templates %]
<option value="[% t.text | html %]" data-problem-state="[% t.state | html %]"> [% t.title | html %] </option>
[% END %]
</select>
-</div>
[% END %]
diff --git a/web/cobrands/zurich/js.js b/web/cobrands/zurich/js.js
index f3977161c..d2909bb6d 100644
--- a/web/cobrands/zurich/js.js
+++ b/web/cobrands/zurich/js.js
@@ -70,7 +70,7 @@ $(function() {
// same or different state to the one we started on
if (state === $(this).data('pstate')) {
$('input[name=publish_response]').show();
- $('.response_templates_select').show();
+ $('.js-template-name').show();
$('#status_update_container').show();
if (state === 'confirmed') {
@@ -85,7 +85,7 @@ $(function() {
}
else {
$('input[name=publish_response]').hide();
- $('.response_templates_select').hide();
+ $('.js-template-name').hide();
$('#status_update_container').hide();
$('#assignation__category').hide();