aboutsummaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-06-06 18:12:41 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-06-06 18:14:54 +0100
commit3677ed59c33ae64ac8dd1e2b15d7072f4dd843cd (patch)
tree38eabd9ab71674ff6be46f9aa0522f88b437f229 /web
parentd63444cb405fa386ad153cab0347df19898bffae (diff)
Improve inspect form position and configurability.
Dealing with the map UI changes earlier leads to a better display position, and we add a global variable check to allow cobrands to not use this behaviour. Fixes #1863.
Diffstat (limited to 'web')
-rw-r--r--web/cobrands/fixmystreet/fixmystreet.js11
-rw-r--r--web/cobrands/fixmystreet/staff.js4
2 files changed, 9 insertions, 6 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js
index 24597c225..bf920c5b8 100644
--- a/web/cobrands/fixmystreet/fixmystreet.js
+++ b/web/cobrands/fixmystreet/fixmystreet.js
@@ -1085,6 +1085,12 @@ fixmystreet.display = {
// Remove any existing report page content from sidebar
$('#side-report').remove();
$('.two_column_sidebar').remove();
+
+ fixmystreet.mobile_reporting.remove_ui();
+ if (fixmystreet.map.updateSize && ($twoColReport.length || $('html').hasClass('mobile'))) {
+ fixmystreet.map.updateSize();
+ }
+
// Insert this report's content
if ($twoColReport.length) {
$twoColReport.appendTo('#map_sidebar');
@@ -1101,11 +1107,6 @@ fixmystreet.display = {
var page_title = found[1];
fixmystreet.page = 'report';
- fixmystreet.mobile_reporting.remove_ui();
- if (fixmystreet.map.updateSize && ($twoColReport.length || $('html').hasClass('mobile'))) {
- fixmystreet.map.updateSize();
- }
-
$('.big-hide-pins-link').hide();
// If this is the first individual report we've loaded, remove the
diff --git a/web/cobrands/fixmystreet/staff.js b/web/cobrands/fixmystreet/staff.js
index 0dd635437..824e8fa0b 100644
--- a/web/cobrands/fixmystreet/staff.js
+++ b/web/cobrands/fixmystreet/staff.js
@@ -225,7 +225,9 @@ $.extend(fixmystreet.set_up, {
}
// Focus on form
- $('html,body').scrollTop($inspect_form.offset().top);
+ if (!fixmystreet.inspect_form_no_scroll_on_load) {
+ document.getElementById('side-inspect').scrollIntoView();
+ }
function updateTemplates(opts) {
opts.category = opts.category || $inspect_form.find('[name=category]').val();