mirror of
https://github.com/FoggedLens/iD.git
synced 2026-04-21 11:16:36 +02:00
add reset button to modified fields
this button only appears if a field's value differs from the original osm value. Resetting changes the value and adds a history entry. It does not undo history.
This commit is contained in:
+12
@@ -918,6 +918,18 @@ a.selected:hover .toggle.icon { background-position: -40px -180px;}
|
||||
background: #eef0ff;
|
||||
}
|
||||
|
||||
.preset-field h4 .modified-icon {
|
||||
opacity: 0.2;
|
||||
display: none;
|
||||
pointer-events: all;
|
||||
}
|
||||
.preset-field h4 .modified-icon:hover {
|
||||
opacity: 0.5;
|
||||
}
|
||||
.preset-field.modified h4 .modified-icon {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.preset-field h4[for*="input-"] {
|
||||
border: 1px solid #cfcfcf;
|
||||
padding: 5px 10px;
|
||||
|
||||
+11
-1
@@ -70,7 +70,17 @@ iD.ui.preset = function(context, entity) {
|
||||
|
||||
sections.append('h4')
|
||||
.attr('for', function(d) { return 'input-' + d.key; })
|
||||
.text(function(d) { return d.label(); });
|
||||
.text(function(d) { return d.label(); })
|
||||
.append('button')
|
||||
.attr('class', 'fr icon undo modified-icon')
|
||||
.on('click', function(d) {
|
||||
var original = context.graph().base().entities[entity.id];
|
||||
var t = {};
|
||||
(d.keys || [d.key]).forEach(function(key) {
|
||||
t[key] = original ? original.tags[key] : undefined;
|
||||
});
|
||||
event.change(t);
|
||||
});
|
||||
|
||||
sections.transition()
|
||||
.style('opacity', 1);
|
||||
|
||||
Reference in New Issue
Block a user