Fix category drawing

This commit is contained in:
Ansis Brammanis
2013-03-04 15:58:17 -05:00
parent 1a43992bd1
commit c7e4977bcb
+18 -17
View File
@@ -60,22 +60,6 @@ iD.ui.PresetGrid = function(context) {
.call(drawButtons);
}
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 drawGrid(selection, presets) {
var entries = selection
@@ -161,7 +145,24 @@ 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() {