Fix enter to select preset

This commit is contained in:
Ansis Brammanis
2013-03-04 16:35:14 -05:00
parent 082bd5fd42
commit 01025ef60f

View File

@@ -60,6 +60,22 @@ iD.ui.PresetGrid = function(context) {
.call(drawButtons);
}
function choose(d) {
// Category
if (d.members) {
search.property('value', '');
presets = d.members;
drawGrid(grid, presets);
// Preset
} else {
context.presets().choose(d);
event.choose(d);
}
}
function name(d) { return d.name; }
function drawGrid(selection, presets) {
var entries = selection
@@ -145,24 +161,7 @@ iD.ui.PresetGrid = function(context) {
entries.exit().remove();
entries.order();
function choose(d) {
// Category
if (d.members) {
search.property('value', '');
presets = d.members;
drawGrid(selection, presets);
// Preset
} else {
context.presets().choose(d);
event.choose(d);
}
}
function name(d) { return d.name; }
}
}
}
function cancel() {