diff --git a/js/id/ui/inspector.js b/js/id/ui/inspector.js index f0981e8f9..cffcb5877 100644 --- a/js/id/ui/inspector.js +++ b/js/id/ui/inspector.js @@ -42,7 +42,7 @@ iD.ui.Inspector = function(context, entity) { .classed('pane tag-pane', true); var presetGrid = iD.ui.PresetGrid(context, entity) - .newFeature(newFeature) + .autofocus(newFeature) .on('close', browse) .on('choose', function(preset) { var right = panewrap.style('right').indexOf('%') > 0 ? '0%' : '0px'; @@ -64,6 +64,7 @@ iD.ui.Inspector = function(context, entity) { .transition() .style('right', right); + presetGrid.autofocus(true); presetLayer.call(presetGrid, preset); }); diff --git a/js/id/ui/preset_grid.js b/js/id/ui/preset_grid.js index ca6218bd5..fec66081f 100644 --- a/js/id/ui/preset_grid.js +++ b/js/id/ui/preset_grid.js @@ -3,7 +3,7 @@ iD.ui.PresetGrid = function(context, entity) { defaultLimit = 9, currentlyDrawn = 9, presets, - newFeature = false; + autofocus = false; function presetgrid(selection, preset) { @@ -103,7 +103,7 @@ iD.ui.PresetGrid = function(context, entity) { searchwrap.append('span') .attr('class', 'icon search'); - if (newFeature) { + if (autofocus) { search.node().focus(); } @@ -246,9 +246,9 @@ iD.ui.PresetGrid = function(context, entity) { } } - presetgrid.newFeature = function(_) { - if (!arguments.length) return newFeature; - newFeature = _; + presetgrid.autofocus = function(_) { + if (!arguments.length) return autofocus; + autofocus = _; return presetgrid; };