Transition in new fields into preset form.

This commit is contained in:
Tom MacWright
2013-03-15 16:02:49 -04:00
parent 76ff5ef6c4
commit 7e7ff52a34

View File

@@ -63,7 +63,11 @@ iD.ui.preset = function(context) {
function addForm(d) {
draw(formwrap, [d]);
d3.select(this).remove();
d3.select(this)
.style('opacity', 1)
.transition().style('opacity', 0).each('end', function() {
d3.select(this).remove();
});
if (!wrap.selectAll('button').node()) wrap.remove();
}
@@ -78,12 +82,15 @@ iD.ui.preset = function(context) {
.data(fields, formKey)
.enter()
.append('div')
.style('opacity', 0)
.attr('class', 'preset-section fillL inspector-inner col12');
sections.append('h4')
.attr('for', function(d) { return 'input-' + d.key; })
.text(function(d) { return d.label(); });
sections.transition().style('opacity', 1);
sections.each(input);
}