From 216a04d96218007c71eeb3ab9ded1e5dba5ba00e Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Thu, 3 Aug 2017 13:32:08 -0400 Subject: [PATCH] Restore code to set state=hover (not sure if actually needed) Also, fix hover style for textarea --- css/80_app.css | 1 + modules/ui/field.js | 17 ++++++++++++----- modules/ui/preset_editor.js | 4 +++- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/css/80_app.css b/css/80_app.css index 98b1adf60..c28651a2b 100644 --- a/css/80_app.css +++ b/css/80_app.css @@ -1146,6 +1146,7 @@ button.save.has-count .count::before { .inspector-hover .form-field-multicombo, .inspector-hover .structure-extras-wrap, .inspector-hover input, +.inspector-hover textarea, .inspector-hover label { background: #ececec; } diff --git a/modules/ui/field.js b/modules/ui/field.js index f8c7cdc48..069dc9805 100644 --- a/modules/ui/field.js +++ b/modules/ui/field.js @@ -10,7 +10,8 @@ import { utilRebind } from '../util'; export function uiField(context, presetField, entity, show) { var dispatch = d3.dispatch('change'), field = _.clone(presetField), - tags; + state = '', + tags = {}; field.impl = uiFields[field.type](field, context) @@ -123,10 +124,9 @@ export function uiField(context, presetField, entity, show) { } var reference = uiTagReference(d.reference || { key: referenceKey }, context); -//FIXME - // if (state === 'hover') { - // reference.showing(false); - // } + if (state === 'hover') { + reference.showing(false); + } d3.select(this) .call(d.impl); @@ -141,6 +141,13 @@ export function uiField(context, presetField, entity, show) { }; + field.state = function(_) { + if (!arguments.length) return state; + state = _; + return field; + }; + + field.tags = function(_) { if (!arguments.length) return tags; tags = _; diff --git a/modules/ui/preset_editor.js b/modules/ui/preset_editor.js index 25d6e6915..5b129651a 100644 --- a/modules/ui/preset_editor.js +++ b/modules/ui/preset_editor.js @@ -75,7 +75,9 @@ export function uiPresetEditor(context) { } fieldsArr.forEach(function(field) { - field.tags(tags); + field + .state(state) + .tags(tags); }); var shown = fieldsArr.filter(function(field) { return field.isShown(); }),