aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-11-15 17:06:14 +0000
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-11-16 12:50:08 +0000
commitffe002094e634462ba2ae303f3ee5cdf090ac1fc (patch)
tree05f5ec4e84fe098a7e0ec0a5532250e9f0faebe5 /web
parentdb75de1ca7268692215dc79f157d61ab7d66fa8e (diff)
Hide update form for inspectors in HTML.
This prevents the form scroll going to the wrong place when the form was being hidden later on.
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/staff.js11
1 files changed, 3 insertions, 8 deletions
diff --git a/web/cobrands/fixmystreet/staff.js b/web/cobrands/fixmystreet/staff.js
index f1e07ed6b..2b7c5b010 100644
--- a/web/cobrands/fixmystreet/staff.js
+++ b/web/cobrands/fixmystreet/staff.js
@@ -330,16 +330,11 @@ $.extend(fixmystreet.set_up, {
});
}
- // Make the "Provide an update" form toggleable, and hide it by default.
+ // Make the "Provide an update" form toggleable, hidden by default.
// (Inspectors will normally just use the #public_update box instead).
- var $updateFormH2 = $('.update-form-heading');
- var $updateFormBtn = $('<button>').insertBefore( $updateFormH2 );
- $updateFormH2.hide().nextAll().hide();
- $updateFormBtn.addClass('btn btn--provide-update');
- $updateFormBtn.text( $updateFormH2.text() );
- $updateFormBtn.on('click', function(e) {
+ $('.js-provide-update').on('click', function(e) {
e.preventDefault();
- $updateFormH2.nextAll().toggle();
+ $(this).next().toggleClass('hidden-js');
});
},