Select filtered preset with Enter

This commit is contained in:
Ansis Brammanis
2013-02-20 17:58:08 -05:00
parent 49e5eb8317
commit 588ef09138
3 changed files with 13 additions and 0 deletions

View File

@@ -677,16 +677,22 @@ a.selected:hover .toggle.icon { background-position: -40px -180px;}
margin-bottom: 20px;
}
.preset-grid.filtered .grid-entry:first-child .grid-inner,
.preset-grid .grid-entry .grid-inner:hover {
background: #ececec;
}
.preset-grid .grid-entry .grid-inner:hover {
background: inherit;
}
.grid-entry .grid-inner {
position: absolute;
border: 1px solid #ccc;
left: 10px; right: 10px; top: 10px; bottom: 10px;
border-radius: 4px;
}
.grid-entry .grid-inner .preset-icon-fill.area {
position: absolute;
opacity: 0.4;

View File

@@ -26,7 +26,13 @@ iD.ui.PresetGrid = function() {
presets = filter(value);
event.message('' + presets.length + ' results for ' + value);
grid.call(drawGrid, presets);
grid.classed('filtered', value.length);
})
.on('change', function() {
var chosen = grid.selectAll('.grid-entry:first-child').datum();
if (chosen) event.choose(chosen);
});
search.node().focus();
function filter(value) {

View File

@@ -113,6 +113,7 @@ iD.ui.TagEditor = function() {
var taglistwrap = editorwrap.append('div').call(tagList, !tagview);
tageditor.tags(tags);
event.change(tags);
}
function drawHead(selection) {