mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-16 13:59:27 +02:00
keyboard navigation for background
This commit is contained in:
@@ -226,6 +226,7 @@ ul.toggle-list li a {
|
||||
text-overflow:ellipsis;
|
||||
overflow:hidden;
|
||||
}
|
||||
ul.toggle-list li a:focus,
|
||||
ul.toggle-list li a:hover { background-color: #ececec;}
|
||||
|
||||
ul.toggle-list .icon {
|
||||
|
||||
@@ -34,6 +34,7 @@ iD.ui.Background = function(context) {
|
||||
function toggle() {
|
||||
tooltip.hide(button);
|
||||
setVisible(content.classed('hide'));
|
||||
content.selectAll('.toggle-list li:first-child a').node().focus();
|
||||
}
|
||||
|
||||
function setVisible(show) {
|
||||
@@ -223,6 +224,13 @@ iD.ui.Background = function(context) {
|
||||
context.background().offset([0, 0]);
|
||||
context.redraw();
|
||||
});
|
||||
|
||||
var keybinding = d3.keybinding('background');
|
||||
|
||||
keybinding.on('b', toggle);
|
||||
|
||||
d3.select(document)
|
||||
.call(keybinding);
|
||||
}
|
||||
|
||||
return d3.rebind(background, event, 'on');
|
||||
|
||||
Reference in New Issue
Block a user