From 7ba3bf3a457b894bf03224d4f54457c51ac76a48 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 2 Oct 2017 09:26:54 -0400 Subject: [PATCH] Don't hard code form-field-structure field name (radiobox with structure extras can be used for other fields) --- css/80_app.css | 4 ++-- modules/ui/fields/radio.js | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/css/80_app.css b/css/80_app.css index 458f64d13..18d63e9fc 100644 --- a/css/80_app.css +++ b/css/80_app.css @@ -1420,12 +1420,12 @@ button.save.has-count .count::before { /* preset form cycleway */ /* preset form structure extras */ -.form-field-structure .structure-extras-wrap li, +.structure-extras-wrap li, .form-field-cycleway .preset-input-wrap li, .form-field-access .preset-input-wrap li { border-bottom: 1px solid #ccc; } -.form-field-structure .structure-extras-wrap li:last-child, +.structure-extras-wrap li:last-child, .form-field-cycleway .preset-input-wrap li:last-child, .form-field-access .preset-input-wrap li:last-child { border-bottom: 0; diff --git a/modules/ui/fields/radio.js b/modules/ui/fields/radio.js index 9cb4d50ea..402662762 100644 --- a/modules/ui/fields/radio.js +++ b/modules/ui/fields/radio.js @@ -25,8 +25,7 @@ export function uiFieldRadio(field, context) { function selectedKey() { - var selector = '.form-field-structure .toggle-list label.active input', - node = d3_selectAll(selector); + var node = wrap.selectAll('.toggle-list label.active input'); return !node.empty() && node.datum(); } @@ -85,7 +84,7 @@ export function uiFieldRadio(field, context) { var extrasWrap = selection.selectAll('.structure-extras-wrap') - .data(selected ? [0] : []); + .data(selected ? [0] : []); extrasWrap.exit() .remove();