mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-14 01:33:03 +00:00
Fix updating preset ui when undoing, address ui
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()));
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user