Commit Graph

14 Commits

Author SHA1 Message Date
Bryan Housel
4583e2d4d7 Make sure all combo event listeners can handle accept/cancel w/o datum
(re: #5637, re: #5618)

This can happen if the user enters a value that is not matched to
one of the combo suggestions.

Also make sure to set `this` to the input field.  It might not be
already if the event was triggered from a keypress instead of a click.
2019-01-22 23:14:34 -05:00
Bryan Housel
09e574983f Don't call formFields.tagsChanged() when presetEditor.tags change
(closes #5690)

This change also makes sure to use the latest copy of the entity in
field.isAllowed() to ensure the prerequisite field check works
and fieldsArr is filtered properly for #5583
2019-01-11 17:42:34 -05:00
Bryan Housel
b575ee8500 Move formFields klass from an argument to a state variable
(maybe needed in case render can get called different ways)
2019-01-11 13:56:16 -05:00
Quincy Morgan
a4b2924e4e Merge branch 'master' into field-prerequisite-tags 2018-12-13 17:23:54 -08:00
Bryan Housel
39b3f1df68 Avoid creating comboboxes
(closes #5568)

Several strategies in here:
- Move uiCombobox() from inside the render function to class variable
- Don't render stuff like the raw tag editor when it's collapsed
- Don't show as many fields/combos on hover
- Don't instantiate fields (like universal/more) until they're actually shown
- Bind the combo on enter selection not on update selection
2018-12-11 16:07:00 -05:00
Bryan Housel
15a54cab17 Use context.container instead of passing it in 2018-12-10 14:14:27 -05:00
Bryan Housel
e5dedeff8b Move lib/d3.combobox.js -> ui/combobox.js
As with other things from this lib/ folder, little original code remains
and turning these things into reusable d3 plugins is not a priority.
2018-12-10 12:38:21 -05:00
Quincy Morgan
5471b909e2 Added mechanism for displaying fields conditionally based on tags 2018-12-09 20:11:31 -08:00
Bryan Housel
ef0636ad01 For fields that use entityID, recreate field if entityID changes
(closes #5229, closes #4898)
2018-08-16 11:07:38 -04:00
Bryan Housel
4a71aa6146 Use safer field ids in classes, element ids, css selectors
Fixes issue with nested/namespaced fields, such as `maxspeed/advisory`,
in situations where would try to use a css selector or element id.
Can't use characters like '/' in a css selector.
2018-03-15 00:57:41 -04:00
Bryan Housel
3d13620705 Convert lodah-es and d3 to named imports for ui 2017-09-26 11:22:43 -04:00
Bryan Housel
59f1df902d When showing a field, set its default value if it has one
This allows universal fields or other standalone fields to have a default value.
This didn't work before becuase default values were only handled by
preset.applyTags() / preset.removeTags().
2017-09-11 15:16:02 -04:00
Bryan Housel
e9909717c7 Change source field to semiCombo, let users pick common source types 2017-08-15 15:15:39 -04:00
Bryan Housel
7563f3ac16 Refactor duplicate form-field code to uiFormFields 2017-08-15 09:35:57 -04:00