keyboard navigation for background

This commit is contained in:
Ansis Brammanis
2013-03-07 16:15:01 -05:00
parent e95cc54396
commit e810cfb666
2 changed files with 9 additions and 0 deletions
+1
View File
@@ -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 {
+8
View File
@@ -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');