Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove aria-hidden from parents of #fms_pan_zoom #3751

Merged
merged 1 commit into from
Feb 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
- Bugfixes:
- Add ID attributes to change password form inputs.
- Fix link deactivation for privacy policy link on privacy policy page. #3704
- Make map pan/zoom controls keyboard-accessible. #3751
- Admin improvements:
- Admin 'add user' form now always creates staff users
- Development improvements:
Expand Down
4 changes: 2 additions & 2 deletions templates/web/base/maps/noscript_map.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[% SET start = c.config.ADMIN_BASE_URL IF admin -%]
<div class="noscript">
<div id="[% nsm_prefix %]drag">
<div id="[% nsm_prefix %]drag" aria-hidden="true">
<[% map.img_type | safe %]
alt="NW map tile" id="[% nsm_prefix %]t2.2"
name="tile_[% map.x_tile - 1 %].[% map.y_tile - 1 %]"
Expand All @@ -23,6 +23,6 @@
src="[% map.tiles.3 %]"
style="top:256px; left:256px;">
</div>
<div id="[% nsm_prefix %]pins">[% FOR pin IN map.pins %][% INCLUDE 'maps/pin.html' %][% END %]</div>
<div id="[% nsm_prefix %]pins" aria-hidden="true">[% FOR pin IN map.pins %][% INCLUDE 'maps/pin.html' %][% END %]</div>
[% INCLUDE 'maps/_compass.html' %]
</div>
4 changes: 2 additions & 2 deletions templates/web/base/maps/noscript_map_base_wmx.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="noscript">
<div id="[% nsm_prefix %]drag">
<div id="[% nsm_prefix %]drag" aria-hidden="true">
[%- FOR row IN map.tiles -%]
[%- FOR tile IN row -%]
[%- top_px = tile.row_offset * map.tile_size -%]
Expand All @@ -13,6 +13,6 @@
[%- END -%]
[% END %]
</div>
<div id="[% nsm_prefix %]pins">[% FOR pin IN map.pins %][% INCLUDE 'maps/pin.html' %][% END %]</div>
<div id="[% nsm_prefix %]pins" aria-hidden="true">[% FOR pin IN map.pins %][% INCLUDE 'maps/pin.html' %][% END %]</div>
[% INCLUDE 'maps/_compass.html' %]
</div>
2 changes: 1 addition & 1 deletion templates/web/base/maps/openlayers.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
[%- END -%]
>
</div>
<div id="map_box" aria-hidden="true">
<div id="map_box">
[% pre_map %]
<div id="map">
[% IF noscript_map_template == 'maps/noscript_map_base_wmx.html' %]
Expand Down
8 changes: 4 additions & 4 deletions templates/web/zurich/maps/noscript_map.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[% IF map.cols %]
<div class="noscript square-map__outer">
<div class="square-map__inner">
<div id="[% nsm_prefix %]drag">
<div id="[% nsm_prefix %]drag" aria-hidden="true">
[%- FOR row IN map.tiles -%]
[%- FOR tile IN row -%]
[%- top_px = tile.row_offset * map.tile_size -%]
Expand All @@ -16,13 +16,13 @@
[%- END -%]
[% END %]
</div>
<div id="[% nsm_prefix %]pins">[% FOR pin IN map.pins %][% INCLUDE pin %][% END %]</div>
<div id="[% nsm_prefix %]pins" aria-hidden="true">[% FOR pin IN map.pins %][% INCLUDE pin %][% END %]</div>
[% INCLUDE 'maps/_compass.html' %]
</div>
</div>
[% ELSE %]
<div class="noscript">
<div id="[% nsm_prefix %]drag">
<div id="[% nsm_prefix %]drag" aria-hidden="true">
<[% map.img_type | safe %]
alt="NW map tile" id="[% nsm_prefix %]t2.2"
name="tile_[% map.x_tile - 1 %].[% map.y_tile - 1 %]"
Expand All @@ -45,7 +45,7 @@
src="[% map.tiles.3 %]"
style="top:256px; left:256px;">
</div>
<div id="[% nsm_prefix %]pins">[% FOR pin IN map.pins %][% INCLUDE 'maps/pin.html' %][% END %]</div>
<div id="[% nsm_prefix %]pins" aria-hidden="true">[% FOR pin IN map.pins %][% INCLUDE 'maps/pin.html' %][% END %]</div>
[% INCLUDE 'maps/_compass.html' %]
</div>
[% END %]
Expand Down
9 changes: 9 additions & 0 deletions web/js/map-OpenLayers.js
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,7 @@ $.extend(fixmystreet.utils, {
});
}
fixmystreet.markers = new OpenLayers.Layer.Vector("Pins", pin_layer_options);
fixmystreet.markers.div.setAttribute('aria-hidden', 'true');
fixmystreet.markers.events.register( 'loadstart', null, fixmystreet.maps.loading_spinner.show);
fixmystreet.markers.events.register( 'loadend', null, fixmystreet.maps.loading_spinner.hide);
OpenLayers.Request.XMLHttpRequest.onabort = function() {
Expand Down Expand Up @@ -989,6 +990,7 @@ $.extend(fixmystreet.utils, {
} else {
layer = new fixmystreet.map_type(fixmystreet.layer_name, layer_options);
}
layer.div.setAttribute('aria-hidden', 'true');
fixmystreet.map.addLayer(layer);
}

Expand Down Expand Up @@ -1035,6 +1037,13 @@ $.extend(fixmystreet.utils, {
// End maps closure
})();

OpenLayers.Control.AttributionFMS = OpenLayers.Class(OpenLayers.Control.Attribution, {
draw: function(){
OpenLayers.Control.Attribution.prototype.draw.apply(this, arguments);
this.div.setAttribute('aria-hidden', 'true');
return this.div;
}
});

/* Overridding the buttonDown function of PanZoom so that it does
zoomTo(0) rather than zoomToMaxExtent()
Expand Down
2 changes: 1 addition & 1 deletion web/js/map-OpenStreetMap.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fixmystreet.maps.config = function() {
fixmystreet.controls = [
new OpenLayers.Control.ArgParserFMS(),
new OpenLayers.Control.Attribution(),
new OpenLayers.Control.AttributionFMS(),
//new OpenLayers.Control.LayerSwitcher(),
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.PermalinkFMS('map'),
Expand Down
2 changes: 1 addition & 1 deletion web/js/map-bing-ol.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
fixmystreet.maps.config = function() {
fixmystreet.controls = [
new OpenLayers.Control.Attribution(),
new OpenLayers.Control.AttributionFMS(),
new OpenLayers.Control.ArgParserFMS(),
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.PermalinkFMS('map'),
Expand Down
2 changes: 1 addition & 1 deletion web/js/map-cheshireeast.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
fixmystreet.maps.config = function() {
fixmystreet.controls = [
new OpenLayers.Control.Attribution(),
new OpenLayers.Control.AttributionFMS(),
new OpenLayers.Control.ArgParserFMS(),
new OpenLayers.Control.Navigation(),
new OpenLayers.Control.PermalinkFMS('map'),
Expand Down