mirror of
https://github.com/FoggedLens/iD.git
synced 2026-03-22 19:13:35 +00:00
states - aria selected/expanded
This commit is contained in:
@@ -47,6 +47,7 @@ export function uiDisclosure(context, key, expandedDefault) {
|
||||
hideToggle
|
||||
.on('click', toggle)
|
||||
.attr('title', t(`icons.${_expanded ? 'collapse' : 'expand'}`))
|
||||
.attr('aria-expanded', _expanded)
|
||||
.classed('expanded', _expanded);
|
||||
|
||||
hideToggle.selectAll('.hide-toggle-text')
|
||||
@@ -85,6 +86,7 @@ export function uiDisclosure(context, key, expandedDefault) {
|
||||
|
||||
hideToggle
|
||||
.classed('expanded', _expanded)
|
||||
.attr('aria-expanded', _expanded)
|
||||
.attr('title', t(`icons.${_expanded ? 'collapse' : 'expand'}`));
|
||||
|
||||
hideToggle.selectAll('.hide-toggle-icon')
|
||||
|
||||
@@ -77,6 +77,7 @@ export function uiGeolocate(context) {
|
||||
|
||||
function updateButtonState() {
|
||||
_button.classed('active', _layer.enabled());
|
||||
_button.attr('aria-selected', _layer.enabled());
|
||||
}
|
||||
|
||||
return function(selection) {
|
||||
@@ -85,6 +86,7 @@ export function uiGeolocate(context) {
|
||||
_button = selection
|
||||
.append('button')
|
||||
.on('click', click)
|
||||
.attr('aria-selected', false)
|
||||
.call(svgIcon('#iD-icon-geolocate', 'light'))
|
||||
.call(uiTooltip()
|
||||
.placement((localizer.textDirection() === 'rtl') ? 'right' : 'left')
|
||||
|
||||
@@ -95,13 +95,15 @@ export function uiSectionRawTagEditor(id, context) {
|
||||
.attr('class', function(d) {
|
||||
return 'raw-tag-option raw-tag-option-' + d.id + (_tagView === d.id ? ' selected' : '');
|
||||
})
|
||||
.attr('aria-selected', function(d) { return _tagView === d.id; })
|
||||
.attr('title', function(d) { return t('icons.' + d.id); })
|
||||
.on('click', function(d3_event, d) {
|
||||
_tagView = d.id;
|
||||
prefs('raw-tag-editor-view', d.id);
|
||||
|
||||
wrap.selectAll('.raw-tag-option')
|
||||
.classed('selected', function(datum) { return datum === d; });
|
||||
.classed('selected', function(datum) { return datum === d; })
|
||||
.attr('aria-selected', function(datum) { return datum === d; });
|
||||
|
||||
wrap.selectAll('.tag-text')
|
||||
.classed('hide', (d.id !== 'text'))
|
||||
|
||||
@@ -137,7 +137,9 @@ export function uiToolOldDrawModes(context) {
|
||||
// update
|
||||
buttons = buttons
|
||||
.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; })
|
||||
.classed('active', function(d) { return context.mode() && context.mode().button === d.button; });
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user