diff options
-rw-r--r-- | .cypress/cypress/integration/regressions.js | 2 | ||||
-rw-r--r-- | .cypress/cypress/integration/responsive.js | 2 | ||||
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | templates/web/base/js/translation_strings.html | 4 | ||||
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 18 | ||||
-rw-r--r-- | web/cobrands/sass/_base.scss | 10 |
6 files changed, 28 insertions, 9 deletions
diff --git a/.cypress/cypress/integration/regressions.js b/.cypress/cypress/integration/regressions.js index f9fedc3eb..f1f557219 100644 --- a/.cypress/cypress/integration/regressions.js +++ b/.cypress/cypress/integration/regressions.js @@ -10,7 +10,7 @@ describe('Regression tests', function() { cy.viewport(480, 800); cy.visit('/around?pc=' + Cypress.env('postcode') + '&js=1'); cy.get('#map_box').click(200, 200); - cy.get('#try_again').click(); + cy.get('#problems_nearby').click(); cy.get('#sub_map_links').should('be.visible'); cy.cleanUpXHR(); }); diff --git a/.cypress/cypress/integration/responsive.js b/.cypress/cypress/integration/responsive.js index 1a5540590..250ec49b7 100644 --- a/.cypress/cypress/integration/responsive.js +++ b/.cypress/cypress/integration/responsive.js @@ -34,7 +34,7 @@ describe('Around page responsive design tests', function() { cy.get('#map_links_toggle').should('not.be.visible'); cy.get('#map_box').click(200, 200); cy.get('#sub_map_links').should('not.be.visible'); - cy.get('#try_again').should('be.visible'); + cy.get('#problems_nearby').should('be.visible'); cy.get('#mob_ok').click(); cy.cleanUpXHR(); }); diff --git a/CHANGELOG.md b/CHANGELOG.md index 727c2b8e3..12ae1e0d1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ - Remove pan control from mobile widths. #2865 - Use category groups whenever category lists are shown. #2702 - Display map inline with duplicate suggestions on mobile. #2668 + - Improved try again process on mobile. #2863 - Admin improvements: - Add new roles system, to group permissions and apply to users. #2483 - Contact form emails now include user admin links. diff --git a/templates/web/base/js/translation_strings.html b/templates/web/base/js/translation_strings.html index bfb1ecf12..7deaf3e05 100644 --- a/templates/web/base/js/translation_strings.html +++ b/templates/web/base/js/translation_strings.html @@ -39,7 +39,7 @@ fixmystreet.password_minimum_length = [% c.cobrand.password_minimum_length %]; fms_extra_title: '[% loc_js('Please enter your title') %]', first_name: '[% loc_js('Please enter your first name') %]', last_name: '[% loc_js('Please enter your second name') %]', - right_place: '[% loc_js('Right place?') %]', + right_place: '[% loc_js('Reposition if needed, then hit Continue') %]', try_again: '[% loc_js('Try again') %]', place_pin_on_map: '[% loc_js('Place pin on map') %]', back: '[% loc_js('Back') %]', @@ -59,7 +59,7 @@ fixmystreet.password_minimum_length = [% c.cobrand.password_minimum_length %]; correct_position: '[% loc_js('Right place?') %]', reporting_a_problem: '[% loc_js('Reporting a problem') %]', - ok: '[% loc_js('OK') %]', + ok: '[% loc_js('Continue') %]', map: '[% loc_js('MAP') %]', map_map: '[% loc_js('Map') %]', diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index c26b10d29..adb935708 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -1459,6 +1459,9 @@ fixmystreet.display = { height = $map_box.height(); $map_box.append( '<p class="sub-map-links" id="mob_sub_map_links">' + + '<a href="#" id="problems_nearby">' + + translation_strings.back + + '</a>' + '<a href="#" id="try_again">' + translation_strings.try_again + '</a>' + @@ -1471,25 +1474,32 @@ fixmystreet.display = { width: width, height: height }); - $('#try_again').click(function(e){ + + $('.mobile-map-banner span').text(translation_strings.right_place); + + $('#problems_nearby').click(function(e){ e.preventDefault(); history.back(); }); - $('.mobile-map-banner span').text(translation_strings.right_place); + $('#try_again').click(function(e) { + e.preventDefault(); + $('#mob_ok').click(); + }); // mobile user clicks 'ok' on map $('#mob_ok').toggle(function(){ //scroll the height of the map box instead of the offset //of the #side-form or whatever as we will probably want //to do this on other pages where #side-form might not be - $('html, body').animate({ scrollTop: height-60 }, 1000, function(){ + $('html, body').animate({ scrollTop: height-60 }, 500, function(){ $('html').removeClass('only-map'); $('#mob_sub_map_links').addClass('map_complete'); $('#mob_ok').text(translation_strings.map); }); }, function(){ - $('html, body').animate({ scrollTop: 0 }, 1000, function(){ + var current = $('html, body').scrollTop(); + $('html, body').animate({ scrollTop: 0 }, 500/height*current, function(){ $('html').addClass('only-map'); $('#mob_sub_map_links').removeClass('map_complete'); $('#mob_ok').text(translation_strings.ok); diff --git a/web/cobrands/sass/_base.scss b/web/cobrands/sass/_base.scss index bdd292e06..b52b75f43 100644 --- a/web/cobrands/sass/_base.scss +++ b/web/cobrands/sass/_base.scss @@ -1816,11 +1816,16 @@ html.js #map .noscript { } } + #problems_nearby, #try_again, #mob_ok { width: 50%; } + #try_again { + display: none; + } + .feed:after { @extend %sub-map-link-icon; background-position: -12px 0; @@ -1876,6 +1881,10 @@ html.js #map .noscript { top: 30px; background-color: rgba(#000, 0.3); + #problems_nearby { + display: none; + } + #try_again, #mob_ok { position: absolute; @@ -1935,7 +1944,6 @@ html.js #map .noscript { .map-fullscreen & { display: block; } - text-transform: uppercase; text-align: center; font-family: $heading-font; line-height: 1em; |