diff options
-rw-r--r-- | web/js/fixmystreet.js | 10 | ||||
-rw-r--r-- | web/js/map-OpenLayers.js | 7 |
2 files changed, 8 insertions, 9 deletions
diff --git a/web/js/fixmystreet.js b/web/js/fixmystreet.js index 2e46580f9..9d24a4ac6 100644 --- a/web/js/fixmystreet.js +++ b/web/js/fixmystreet.js @@ -90,15 +90,7 @@ $(function(){ // we do this to stop things jumping around on blur success: function (err) { if ( form_submitted ) { err.addClass('label-valid').html( ' ' ); } else { err.addClass('label-valid-hidden'); } }, errorPlacement: function( error, element ) { - /* Manipulating elements that were hidden and have now - * been shown doesn't seem to work very well on at least - * iOS5 so we have to treat it differently */ - if (navigator.userAgent.match(/like Mac OS X/i)) { - var html = element.parent('div').html(); - element.parent('div').html( error[0].outerHTML + html ); - } else { - element.parent('div').before( error ); - } + element.parent('div').before( error ); }, submitHandler: function(form) { if (form.submit_problem) { diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index d0b712618..fa93c2f4c 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -362,6 +362,13 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { } }); $('#side-form').show(); + /* For some reason on IOS5 if you use the jQuery show method it + * doesn't display the JS validation error messages unless you do this + * or you cause a screen redraw by changing the phone orientation. + * NB: This has to happen after the call to show() */ + if ( navigator.userAgent.match(/like Mac OS X/i)) { + document.getElementById('side-form').style.display = 'block'; + } $('#side').hide(); $('#sub_map_links').hide(); fixmystreet.page = 'new'; |