Commit Graph

197 Commits

Author SHA1 Message Date
Andreas Haessler
82ea58d943 Add default value to number field 2019-02-04 15:59:08 +01:00
Bryan Housel
d0021f77ca Handle possibility of combobox blurring without dispatching accept 2019-01-28 13:43:40 -05:00
Bryan Housel
18d71448be pacify eslint 2019-01-25 16:23:46 -05:00
Bryan Housel
5d6e331635 Don't erase name field when tabbing from it
(closes #5760)
2019-01-25 16:16:07 -05:00
Quincy Morgan
decba8f215 Fix cycleway field to appear if "cycleway" tag present but not "cycleway:left" nor "cycleway:right" (close #5756) 2019-01-25 08:39:15 -05:00
Bryan Housel
20bcfc5730 Delimit name-suggestion-preset names on en-dash, not hyphen
To avoid conflicts with hyphenated names, or bilingual names
with hyphens in them (like used in Brussels)
2019-01-23 09:44:24 -05:00
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
Quincy Morgan
46beb31e74 Removed extra padding in comboboxes when the caret is hidden 2019-01-18 11:59:40 -05:00
Quincy Morgan
bf2574f4e3 Hide the dropdown arrow in combo fields if there are no suggestions from tagInfo (closes #5730) 2019-01-18 11:21:31 -05:00
Quincy Morgan
bc81a62a58 Made the value chips in the Destinations semiCombo field full-width to mimic the layout of highway signs (re: #4178)
The input and combobox caret elements in the multicombo field value list are now wrapped in a li element for consistency
2019-01-18 10:41:51 -05:00
Quincy Morgan
77cfde7913 combo, multiCombo, and semiCombo fields now correctly submit the typed value upon pressing enter/return without deselecting the feature (closes #5725) 2019-01-17 15:42:35 -05:00
Quincy Morgan
90637bdcfa Fixed an issue where the cycleway field would throw an error when added from the "Add field:" dropdown 2019-01-17 12:32:14 -05:00
Bryan Housel
c635389c1a Fix handling of semicolon delimited values in numeric field
(closes #5438)
2018-12-12 01:11:34 -05: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
ff646fa2c8 Dispatch a 'cancel' event if the user hits escape 2018-12-11 00:09:55 -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
Bryan Housel
d574bfcd77 Disable autocomplete on the localized field
(closes #5558)
2018-12-07 17:19:02 -05:00
Bryan Housel
247900f727 Change several of the event things, remove numeric index
re: https://github.com/openstreetmap/iD/issues/5558#issuecomment-445307568
2018-12-07 16:54:32 -05:00
Bryan Housel
8b2e5c98bd Fix tests - test for _entity before using it 2018-12-02 01:46:35 -05:00
Bryan Housel
0a286bbd9d Lock name field when there is a wikidata tag
(re: #5515)
2018-12-02 00:14:51 -05:00
Bryan Housel
f559fc57bb Silly code formatting stuff, remove unused .entity() accessor
- prefix state variables with a _
- var on each line
2018-12-01 21:51:08 -05:00
Quincy Morgan
55c47021fa Fixes Wikidata field lint errors 2018-12-01 18:14:51 -08:00
Quincy Morgan
afcc474d3c Wikidata entity labels and descriptions are now fetched and displayed in the field, if present 2018-12-01 17:39:16 -08:00
Quincy Morgan
a28147aea2 Updates Wikidata field for the latest field flexbox changes
Adds an Identifier label to the Wikidata QID input
2018-12-01 13:16:41 -08:00
Quincy Morgan
3643877be6 Merge branch 'master' into wikidata-field 2018-12-01 11:57:09 -08:00
Quincy Morgan
b0dccc81de Condenses CSS for access, cycleway, and structure field lists 2018-12-01 11:55:21 -08:00
Bryan Housel
8b0e729b9c Merge pull request #5502 from jguthrie100/redraw_restrictions_on_sidebar_drag
Redraw restrictions panel when dragging sidebar
2018-11-30 01:30:03 -05:00
Bryan Housel
50d204866b Flexbox the raw member, membership controls, finish tag editor 2018-11-29 22:31:58 -05:00
Bryan Housel
d0612ba519 Fix css for address and wikipedia fields, fix hover styles 2018-11-28 23:20:52 -05:00
Bryan Housel
958d7fac4f wip changing all fields to use flexbox everywhere 2018-11-28 18:15:38 -05:00
Bryan Housel
0b98811377 Avoid multiline variable declaration 2018-11-27 11:22:13 -05:00
Bryan Housel
4533603a88 preset-input-wrap -> form-field-input-wrap
This better describes what it does.
Also, took this opportunity to update a bunch of the uifield code
(no multi line variable declarations, prefix state variables with _,
eliminate unnecessray lodash, etc)
2018-11-27 10:54:03 -05:00
Bryan Housel
986b663c9e Get rid of extra form-label-button-wrap div
Buttons can now be directly appended to the form-field-label flex container
2018-11-27 09:14:11 -05:00
Bryan Housel
7170e93b39 Adjust tooltip 2018-11-26 17:35:38 -05:00
Bryan Housel
df91eb2959 Cleanup style, make sure multilingual fields always render 2018-11-26 17:13:55 -05:00
Bryan Housel
9341e477a6 Merge remote-tracking branch 'origin/master' into brand-name-protection 2018-11-26 15:27:56 -05:00
Bryan Housel
f6f146f79b Lock down some fields when a brand preset has been chosen 2018-11-26 15:13:40 -05:00
J Guthrie
82bc803bb0 Lower redraw threshold to 1px 2018-11-26 01:43:51 +00:00
Bryan Housel
ae063e9616 Make name and brand fields readonly on suggestion presets
(re #5515)
2018-11-23 23:44:52 -05:00
Quincy Morgan
e2b2649976 Merge pull request #5498 from quincylvania/form-field-flexbox
Flexbox preset field, member, and membership UI
2018-11-21 20:14:36 -05:00
Bryan Housel
ea9e3008a5 addTags() -> setTags() / removeTags() -> unsetTags()
This avoids overriding the `addTags` and `removeTags` objects with functions
2018-11-21 12:59:43 -05:00
Bryan Housel
2699418c3e Disable the name field when matching a suggestion preset
(re: #5515)
2018-11-21 12:40:12 -05:00
Bryan Housel
622621ca89 Improve suggestion combo behavior in the name field
- adds minItems(1) so it will match
- displays up to 10 suggestions
- correctly removes old tags by setting the `undefined`
- adjust the name distance scoring
- only shows name suggestions if the preset can benefit from them
  (i.e. a generic/fallback or a preset that has some suggestions in the index)
2018-11-21 11:15:03 -05:00
J Guthrie
7bf4c462e8 Lowered redraw threshold to 2px 2018-11-21 09:25:30 +00:00
J Guthrie
c002ab8b1d Only redraw restrictions panel every 10px sidebar is dragged 2018-11-21 09:05:33 +00:00
Bryan Housel
e3f5aecda9 Remove dataSuggestions and utilSuggestNames
- dataSuggestions was just a reexport of the name-suggestion-index
- utilSuggestNames was a combobox fetcher function used only once by uiFieldLocalized
    Doesn't need to be a util if it's only used once in the code
    and the tests for it were not really that interesting
2018-11-20 21:27:32 -05:00
J Guthrie
5fc312620f Converted to using custom Event 2018-11-20 18:39:00 +00:00
J Guthrie
6137941efd Redraw restrictions panel when dragging sidebar 2018-11-19 15:23:30 +00:00
Quincy Morgan
82263aea7c Adds a Wikidata field 2018-11-18 19:38:19 -05:00