From ad31b9f53f1350accfaee3475fed33b0c4da9cba Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Mon, 18 Mar 2013 14:23:06 -0700 Subject: [PATCH] Add preset-field class to fields (fixes #1000) --- css/app.css | 22 +++++++++++----------- js/id/ui/preset.js | 6 ++++-- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/css/app.css b/css/app.css index b37599cd3..3a4f866e4 100644 --- a/css/app.css +++ b/css/app.css @@ -839,7 +839,7 @@ a.selected:hover .toggle.icon { background-position: -40px -180px;} /* preset form basics */ -.preset-section.inspector-inner { +.preset-field.inspector-inner { padding-bottom: 0; } @@ -863,7 +863,7 @@ a.selected:hover .toggle.icon { background-position: -40px -180px;} } .inspector-body .name h4, -.preset-section h4[for*="input-"] { +.preset-field h4[for*="input-"] { border: 1px solid #cfcfcf; padding: 5px 10px; background: #f6f6f6; @@ -875,21 +875,21 @@ a.selected:hover .toggle.icon { background-position: -40px -180px;} z-index: 2; } -.preset-section h4 + input, +.preset-field h4 + input, h4 + .input-wrap-position input, h4 + .preset-input input:first-child { padding-top: 35px; height: 60px; } -.preset-section h4 + textarea { +.preset-field h4 + textarea { padding-top: 35px; height: 100px; } -.preset-section h4[for="input-building:levels"], -.preset-section h4[for="input-ele"], -.preset-section.checkselect h4 { +.preset-field h4[for="input-building:levels"], +.preset-field h4[for="input-ele"], +.preset-field.checkselect h4 { right: 50%;} /* adding additional preset fields */ @@ -1025,25 +1025,25 @@ input[type=number] { /* Preset form address */ -.preset-section .addr-housename { +.preset-field .addr-housename { border-bottom: none; border-radius: 4px 4px 0 0; } -.preset-section .addr-number { +.preset-field .addr-number { width: 20%; border-right: none; border-bottom: none; border-radius: 0; } -.preset-section .addr-street { +.preset-field .addr-street { width: 80%; border-radius: 0; border-bottom: none; } -.preset-section .addr-city { +.preset-field .addr-city { border-radius: 0 0 4px 4px; } diff --git a/js/id/ui/preset.js b/js/id/ui/preset.js index 6648df3f0..99d151e3d 100644 --- a/js/id/ui/preset.js +++ b/js/id/ui/preset.js @@ -78,12 +78,14 @@ iD.ui.preset = function(context) { } function draw(selection, fields) { - var sections = selection.selectAll('div.preset-section') + var sections = selection.selectAll('div.preset-field') .data(fields, formKey) .enter() .append('div') .style('opacity', 0) - .attr('class', 'preset-section fillL inspector-inner col12'); + .attr('class', function(field) { + return 'preset-field preset-field-' + field.id + ' fillL inspector-inner col12'; + }); sections.append('h4') .attr('for', function(d) { return 'input-' + d.key; })