From 7e7ff52a340730b7cde52ea4ee404aa5f9b158d7 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Fri, 15 Mar 2013 16:02:49 -0400 Subject: [PATCH] Transition in new fields into preset form. --- js/id/ui/preset.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/js/id/ui/preset.js b/js/id/ui/preset.js index 0dbd91e8f..6648df3f0 100644 --- a/js/id/ui/preset.js +++ b/js/id/ui/preset.js @@ -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); }