Revert and inspector buttons should not focus the form. Fixes #1139

This commit is contained in:
Tom MacWright
2013-03-26 12:31:55 -04:00
parent 93104c268f
commit e0dc20ff58
+6 -4
View File
@@ -68,6 +68,8 @@ iD.ui.preset = function(context, entity, preset) {
}
function revert(field) {
d3.event.stopPropagation();
d3.event.preventDefault();
var t = {};
field.keys.forEach(function(key) {
t[key] = original ? original.tags[key] : undefined;
@@ -76,6 +78,8 @@ iD.ui.preset = function(context, entity, preset) {
}
function toggleReference(field) {
d3.event.stopPropagation();
d3.event.preventDefault();
_.forEach(fields, function(other) {
if (other.id === field.id) {
other.showingReference = !other.showingReference;
@@ -113,8 +117,6 @@ iD.ui.preset = function(context, entity, preset) {
.attr('for', function(field) { return 'preset-input-' + field.id; })
.text(function(field) { return field.label(); });
label.append('button')
.attr('class', 'tag-reference-button fr')
.attr('tabindex', -1)
@@ -157,14 +159,14 @@ iD.ui.preset = function(context, entity, preset) {
.style('padding-top', '20px')
.style('max-height', '200px')
.style('opacity', '1');
} else {
} else {
d3.select(this)
.call(iD.ui.TagReference(entity, {key: field.key}))
.transition()
.duration(200)
.style('max-height', '0px')
.style('padding-top', '0px')
.style('opacity', '0');
.style('opacity', '0');
}
});