mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-14 21:28:11 +02:00
aria-pressed on modes/notes tablist/tab on raw_tag
This commit is contained in:
@@ -77,7 +77,7 @@ export function uiGeolocate(context) {
|
||||
|
||||
function updateButtonState() {
|
||||
_button.classed('active', _layer.enabled());
|
||||
_button.attr('aria-selected', _layer.enabled());
|
||||
_button.attr('aria-pressed', _layer.enabled());
|
||||
}
|
||||
|
||||
return function(selection) {
|
||||
@@ -86,7 +86,7 @@ export function uiGeolocate(context) {
|
||||
_button = selection
|
||||
.append('button')
|
||||
.on('click', click)
|
||||
.attr('aria-selected', false)
|
||||
.attr('aria-pressed', false)
|
||||
.call(svgIcon('#iD-icon-geolocate', 'light'))
|
||||
.call(uiTooltip()
|
||||
.placement((localizer.textDirection() === 'rtl') ? 'right' : 'left')
|
||||
|
||||
@@ -84,7 +84,8 @@ export function uiSectionRawTagEditor(id, context) {
|
||||
|
||||
var optionsEnter = options.enter()
|
||||
.insert('div', ':first-child')
|
||||
.attr('class', 'raw-tag-options');
|
||||
.attr('class', 'raw-tag-options')
|
||||
.attr('role', 'tablist');
|
||||
|
||||
var optionEnter = optionsEnter.selectAll('.raw-tag-option')
|
||||
.data(availableViews, function(d) { return d.id; })
|
||||
@@ -96,6 +97,7 @@ export function uiSectionRawTagEditor(id, context) {
|
||||
return 'raw-tag-option raw-tag-option-' + d.id + (_tagView === d.id ? ' selected' : '');
|
||||
})
|
||||
.attr('aria-selected', function(d) { return _tagView === d.id; })
|
||||
.attr('role', 'tab')
|
||||
.attr('title', function(d) { return t('icons.' + d.id); })
|
||||
.on('click', function(d3_event, d) {
|
||||
_tagView = d.id;
|
||||
|
||||
@@ -139,7 +139,7 @@ export function uiToolOldDrawModes(context) {
|
||||
.merge(buttonsEnter)
|
||||
.attr('aria-disabled', function(d) { return !enabled(d); })
|
||||
.classed('disabled', function(d) { return !enabled(d); })
|
||||
.attr('aria-selected', function(d) { return context.mode() && context.mode().button === d.button; })
|
||||
.attr('aria-pressed', function(d) { return context.mode() && context.mode().button === d.button; })
|
||||
.classed('active', function(d) { return context.mode() && context.mode().button === d.button; });
|
||||
}
|
||||
};
|
||||
|
||||
@@ -108,7 +108,9 @@ export function uiToolNotes(context) {
|
||||
buttons = buttons
|
||||
.merge(buttonsEnter)
|
||||
.classed('disabled', function(d) { return !enabled(d); })
|
||||
.classed('active', function(d) { return context.mode() && context.mode().button === d.button; });
|
||||
.attr('aria-disabled', function(d) { return !enabled(d); })
|
||||
.classed('active', function(d) { return context.mode() && context.mode().button === d.button; })
|
||||
.attr('aria-pressed', function(d) { return context.mode() && context.mode().button === d.button; });
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user