diff --git a/js/id/modes/select.js b/js/id/modes/select.js index 55962c81a..93bb991c1 100644 --- a/js/id/modes/select.js +++ b/js/id/modes/select.js @@ -124,12 +124,8 @@ iD.modes.Select = function(context, selection, initial) { // Exit mode if selected entity gets undone context.enter(iD.modes.Browse(context)); - } else if (entity) { - var newEntity = context.entity(selection[0]); - if (!_.isEqual(entity.tags, newEntity.tags)) { - inspector.tags(newEntity.tags); - } - entity = newEntity; + } else if (singular()) { + inspector.tags(context.entity(selection[0]).tags); } } @@ -238,7 +234,8 @@ iD.modes.Select = function(context, selection, initial) { keybinding.off(); context.history() - .on('change.select', null); + .on('undone.select', null) + .on('redone.select', null); context.surface() .call(radialMenu.close) diff --git a/js/id/ui/address.js b/js/id/ui/address.js index bb1fcc9a8..4164330e9 100644 --- a/js/id/ui/address.js +++ b/js/id/ui/address.js @@ -1,6 +1,6 @@ iD.ui.preset.address = function() { - var event = d3.dispatch(), + var event = d3.dispatch('change'), context, entity; @@ -36,17 +36,23 @@ iD.ui.preset.address = function() { function address(selection) { + function change() { event.change(); } + selection.append('input') .property('type', 'text') .attr('placeholder', 'Housename') .attr('class', 'addr-housename') - .datum({ 'key': 'addr:housename' }); + .datum({ 'key': 'addr:housename' }) + .on('blur', change) + .on('change', change); selection.append('input') .property('type', 'text') .attr('placeholder', '123') .attr('class', 'addr-number') - .datum({ 'key': 'addr:housenumber' }); + .datum({ 'key': 'addr:housenumber' }) + .on('blur', change) + .on('change', change); var streetwrap = selection.append('span') .attr('class', 'input-wrap-position') @@ -55,7 +61,9 @@ iD.ui.preset.address = function() { streetwrap.append('input') .property('type', 'text') .attr('placeholder', 'Oak Street') - .attr('class', 'addr-streetname'); + .attr('class', 'addr-streetname') + .on('blur', change) + .on('change', change); streetwrap.call(d3.combobox().data(getStreets())); } diff --git a/js/id/ui/preset.js b/js/id/ui/preset.js index c49daa6bc..5419028cc 100644 --- a/js/id/ui/preset.js +++ b/js/id/ui/preset.js @@ -22,9 +22,7 @@ iD.ui.preset = function() { if (!sections) return; sections.selectAll('input,select') .each(function(d) { - if (tags[d.key]) { - this.value = tags[d.key]; - } + this.value = tags[d.key] || ''; }); } @@ -142,8 +140,9 @@ iD.ui.preset = function() { wrap.append('div') .attr('class', 'col9 preset-input', d) .call(iD.ui.preset.address() - .context(context) - .entity(entity)); + .context(context) + .on('change', key) + .entity(entity)); } } });