From eafd2cec3ec2856942f3362e8a1460b348f862d8 Mon Sep 17 00:00:00 2001 From: Quincy Morgan Date: Sun, 7 Apr 2019 14:05:31 -0700 Subject: [PATCH] Add a tooltip to the plus button in the "All relations" section (re: #3812) --- data/core.yaml | 1 + dist/locales/en.json | 1 + modules/ui/raw_membership_editor.js | 11 ++++++++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/data/core.yaml b/data/core.yaml index 5e98b9c13..d7b123749 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -474,6 +474,7 @@ en: all_tags: All tags all_members: All members all_relations: All relations + add_to_relation: Add to a relation new_relation: New relation... choose_relation: Choose a parent relation role: Role diff --git a/dist/locales/en.json b/dist/locales/en.json index 1c02fa45c..b37aeb307 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -584,6 +584,7 @@ "all_tags": "All tags", "all_members": "All members", "all_relations": "All relations", + "add_to_relation": "Add to a relation", "new_relation": "New relation...", "choose_relation": "Choose a parent relation", "role": "Role", diff --git a/modules/ui/raw_membership_editor.js b/modules/ui/raw_membership_editor.js index d3b36f3f7..0d9d1b606 100644 --- a/modules/ui/raw_membership_editor.js +++ b/modules/ui/raw_membership_editor.js @@ -3,7 +3,7 @@ import { select as d3_select } from 'd3-selection'; -import { t } from '../util/locale'; +import { t, textDirection } from '../util/locale'; import { actionAddEntity, @@ -17,6 +17,7 @@ import { osmEntity, osmRelation } from '../osm'; import { services } from '../services'; import { svgIcon } from '../svg'; import { uiCombobox, uiDisclosure } from './index'; +import { tooltip } from '../util/tooltip'; import { utilArrayGroupBy, utilDisplayName, utilNoAuto, utilHighlightEntities } from '../util'; @@ -308,10 +309,14 @@ export function uiRawMembershipEditor(context) { .append('div') .attr('class', 'add-row'); - addRowEnter + var addRelationButton = addRowEnter .append('button') - .attr('class', 'add-relation') + .attr('class', 'add-relation'); + + addRelationButton .call(svgIcon('#iD-icon-plus', 'light')); + addRelationButton + .call(tooltip().title(t('inspector.add_to_relation')).placement(textDirection === 'ltr' ? 'right' : 'left')); addRowEnter .append('div')