diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 11 | ||||
-rw-r--r-- | web/cobrands/fixmystreet/staff.js | 8 |
2 files changed, 11 insertions, 8 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index 032140298..8073530c6 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -660,6 +660,11 @@ $.extend(fixmystreet.set_up, { }, dropzone: function($context) { + if ('Dropzone' in window) { + Dropzone.autoDiscover = false; + } else { + return; + } // Pass a jQuery element, eg $('.foobar'), into this function // to limit all the selectors to that element. Handy if you want @@ -670,12 +675,6 @@ $.extend(fixmystreet.set_up, { $context = $(document); } - if ('Dropzone' in window) { - Dropzone.autoDiscover = false; - } else { - return; - } - var forms = $('[for="form_photo"], .js-photo-label', $context).closest('form'); forms.each(function() { // Internal $context is the individual form with the photo upload inside diff --git a/web/cobrands/fixmystreet/staff.js b/web/cobrands/fixmystreet/staff.js index 89d7cab39..e62ae6ba7 100644 --- a/web/cobrands/fixmystreet/staff.js +++ b/web/cobrands/fixmystreet/staff.js @@ -137,6 +137,10 @@ fixmystreet.staff_set_up = { document.getElementById('side-inspect').scrollIntoView(); } + // make sure dropzone is set up, otherwise loading problem with + // JS leaves this uninitialized. + fixmystreet.set_up.dropzone($inspect_form); + function updateTemplates(opts) { opts.category = opts.category || $inspect_form.find('[name=category]').val(); opts.state = opts.state || $inspect_form.find('[name=state]').val(); @@ -212,9 +216,9 @@ fixmystreet.staff_set_up = { var $checkbox = $(this); var toggle_public_update = function() { if ($checkbox.prop('checked')) { - $('#public_update').parents('p').show(); + $('#public_update_form_fields').show(); } else { - $('#public_update').parents('p').hide(); + $('#public_update_form_fields').hide(); } }; $checkbox.on('change', function() { |