Add 'current' class to current preset in grid

This commit is contained in:
Ansis Brammanis
2013-03-18 17:18:32 -04:00
parent da21a4737d
commit 425fd838ce
3 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -56,12 +56,12 @@ iD.ui.Inspector = function(context, entity) {
.tags(entity.tags)
.on('changeTags', changeTags)
.on('close', browse)
.on('choose', function() {
.on('choose', function(preset) {
panewrap
.transition()
.style('right', '-100%');
presetLayer.call(presetGrid, true);
presetLayer.call(presetGrid, preset);
});
var initial = entity.isNew() && _.without(Object.keys(entity.tags), 'area').length === 0;
+1
View File
@@ -191,6 +191,7 @@ iD.ui.PresetGrid = function(context, entity) {
var entered = entries.enter()
.append('div')
.attr('class','grid-button-wrap col4 grid-entry-wrap')
.classed('current', function(d) { return d === preset; })
.append('button')
.attr('class', 'grid-entry')
.on('click', choose);
+1 -1
View File
@@ -35,7 +35,7 @@ iD.ui.TagEditor = function(context, entity) {
.title(t('inspector.back_tooltip'))
.placement('left'))
.on('click', function() {
event.choose();
event.choose(preset);
})
.append('span').attr('class','icon back');