mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 21:48:20 +02:00
Make popover and tooltip part of the UI module instead of utils
This commit is contained in:
@@ -6,7 +6,7 @@ import { t } from '../util/locale';
|
||||
import { osmChangeset } from '../osm';
|
||||
import { svgIcon } from '../svg/icon';
|
||||
import { services } from '../services';
|
||||
import { tooltip } from '../util/tooltip';
|
||||
import { uiTooltip } from './tooltip';
|
||||
import { uiChangesetEditor } from './changeset_editor';
|
||||
import { uiSectionChanges } from './sections/changes';
|
||||
import { uiCommitWarnings } from './commit_warnings';
|
||||
@@ -380,11 +380,11 @@ export function uiCommit(context) {
|
||||
});
|
||||
|
||||
// remove any existing tooltip
|
||||
tooltip().destroyAny(buttonSection.selectAll('.save-button'));
|
||||
uiTooltip().destroyAny(buttonSection.selectAll('.save-button'));
|
||||
|
||||
if (uploadBlockerTooltipText) {
|
||||
buttonSection.selectAll('.save-button')
|
||||
.call(tooltip().title(uploadBlockerTooltipText).placement('top'));
|
||||
.call(uiTooltip().title(uploadBlockerTooltipText).placement('top'));
|
||||
}
|
||||
|
||||
// Raw Tag Editor
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { t } from '../util/locale';
|
||||
import { svgIcon } from '../svg/icon';
|
||||
import { tooltip } from '../util/tooltip';
|
||||
import { uiTooltip } from './tooltip';
|
||||
import { utilEntityOrMemberSelector } from '../util';
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ export function uiCommitWarnings(context) {
|
||||
.attr('class', 'issue-message');
|
||||
|
||||
itemsEnter.filter(function(d) { return d.tooltip; })
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.title(function(d) { return d.tooltip; })
|
||||
.placement('top')
|
||||
);
|
||||
|
||||
@@ -2,7 +2,7 @@ import { event as d3_event } from 'd3-selection';
|
||||
|
||||
import { t } from '../util/locale';
|
||||
import { uiTooltipHtml } from './tooltipHtml';
|
||||
import { tooltip } from '../util/tooltip';
|
||||
import { uiTooltip } from './tooltip';
|
||||
|
||||
|
||||
export function uiFeatureInfo(context) {
|
||||
@@ -20,7 +20,7 @@ export function uiFeatureInfo(context) {
|
||||
selection.html('');
|
||||
|
||||
if (hiddenList.length) {
|
||||
var tooltipBehavior = tooltip()
|
||||
var tooltipBehavior = uiTooltip()
|
||||
.placement('top')
|
||||
.html(true)
|
||||
.title(function() {
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ import { event as d3_event, select as d3_select } from 'd3-selection';
|
||||
import { t } from '../util/locale';
|
||||
import { textDirection } from '../util/locale';
|
||||
import { svgIcon } from '../svg/icon';
|
||||
import { tooltip } from '../util/tooltip';
|
||||
import { uiTooltip } from './tooltip';
|
||||
import { geoExtent } from '../geo/extent';
|
||||
import { uiFieldHelp } from './field_help';
|
||||
import { uiFields } from './fields';
|
||||
@@ -30,7 +30,7 @@ export function uiField(context, presetField, entityIDs, options) {
|
||||
var _tags = {};
|
||||
|
||||
var _locked = false;
|
||||
var _lockedTip = tooltip()
|
||||
var _lockedTip = uiTooltip()
|
||||
.title(t('inspector.lock.suggestion', { label: field.label }))
|
||||
.placement('bottom');
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import { currentLocale, t, languageName } from '../../util/locale';
|
||||
import { geoExtent } from '../../geo';
|
||||
import { services } from '../../services';
|
||||
import { svgIcon } from '../../svg';
|
||||
import { tooltip } from '../../util/tooltip';
|
||||
import { uiTooltip } from '../tooltip';
|
||||
import { uiCombobox } from '../combobox';
|
||||
import { utilDetect } from '../../util/detect';
|
||||
import { utilArrayUniq, utilEditDistance, utilGetSetValue, utilNoAuto, utilRebind } from '../../util';
|
||||
@@ -51,7 +51,7 @@ export function uiFieldLocalized(field, context) {
|
||||
|
||||
var _selection = d3_select(null);
|
||||
var _multilingual = [];
|
||||
var _buttonTip = tooltip()
|
||||
var _buttonTip = uiTooltip()
|
||||
.title(t('translate.translate'))
|
||||
.placement('left');
|
||||
var _wikiTitles;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { select as d3_select } from 'd3-selection';
|
||||
|
||||
import { t, textDirection } from '../util/locale';
|
||||
import { tooltip } from '../util/tooltip';
|
||||
import { uiTooltip } from './tooltip';
|
||||
import { geoExtent } from '../geo';
|
||||
import { modeBrowse } from '../modes/browse';
|
||||
import { svgIcon } from '../svg/icon';
|
||||
@@ -87,7 +87,7 @@ export function uiGeolocate(context) {
|
||||
.append('button')
|
||||
.on('click', click)
|
||||
.call(svgIcon('#iD-icon-geolocate', 'light'))
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.placement((textDirection === 'rtl') ? 'right' : 'left')
|
||||
.html(true)
|
||||
.title(uiTooltipHtml(t('geolocate.title'), t('geolocate.key')))
|
||||
|
||||
@@ -42,6 +42,7 @@ export { uiNoteComments } from './note_comments';
|
||||
export { uiNoteEditor } from './note_editor';
|
||||
export { uiNoteHeader } from './note_header';
|
||||
export { uiNoteReport } from './note_report';
|
||||
export { uiPopover } from './popover';
|
||||
export { uiPresetIcon } from './preset_icon';
|
||||
export { uiPresetList } from './preset_list';
|
||||
export { uiRestore } from './restore';
|
||||
@@ -54,6 +55,7 @@ export { uiStatus } from './status';
|
||||
export { uiSuccess } from './success';
|
||||
export { uiTagReference } from './tag_reference';
|
||||
export { uiToggle } from './toggle';
|
||||
export { uiTooltip } from './tooltip';
|
||||
export { uiTooltipHtml } from './tooltipHtml';
|
||||
export { uiVersion } from './version';
|
||||
export { uiViewOnOSM } from './view_on_osm';
|
||||
|
||||
+3
-4
@@ -5,8 +5,6 @@ import {
|
||||
|
||||
import { t, textDirection, setLocale } from '../util/locale';
|
||||
|
||||
import { tooltip } from '../util/tooltip';
|
||||
|
||||
import { behaviorHash } from '../behavior';
|
||||
import { modeBrowse } from '../modes/browse';
|
||||
import { svgDefs, svgIcon } from '../svg';
|
||||
@@ -34,6 +32,7 @@ import { uiSidebar } from './sidebar';
|
||||
import { uiSpinner } from './spinner';
|
||||
import { uiSplash } from './splash';
|
||||
import { uiStatus } from './status';
|
||||
import { uiTooltip } from './tooltip';
|
||||
import { uiTopToolbar } from './top_toolbar';
|
||||
import { uiVersion } from './version';
|
||||
import { uiZoom } from './zoom';
|
||||
@@ -216,14 +215,14 @@ export function uiInit(context) {
|
||||
.attr('target', '_blank')
|
||||
.attr('href', 'https://github.com/openstreetmap/iD/issues')
|
||||
.call(svgIcon('#iD-icon-bug', 'light'))
|
||||
.call(tooltip().title(t('report_a_bug')).placement('top'));
|
||||
.call(uiTooltip().title(t('report_a_bug')).placement('top'));
|
||||
|
||||
issueLinks
|
||||
.append('a')
|
||||
.attr('target', '_blank')
|
||||
.attr('href', 'https://github.com/openstreetmap/iD/blob/develop/CONTRIBUTING.md#translating')
|
||||
.call(svgIcon('#iD-icon-translate', 'light'))
|
||||
.call(tooltip().title(t('help_translate')).placement('top'));
|
||||
.call(uiTooltip().title(t('help_translate')).placement('top'));
|
||||
|
||||
aboutList
|
||||
.append('li')
|
||||
|
||||
@@ -2,7 +2,7 @@ import { event as d3_event, select as d3_select } from 'd3-selection';
|
||||
|
||||
import { svgIcon } from '../svg/icon';
|
||||
import { t } from '../util/locale';
|
||||
import { tooltip } from '../util/tooltip';
|
||||
import { uiTooltip } from './tooltip';
|
||||
|
||||
|
||||
export function uiIssuesInfo(context) {
|
||||
@@ -60,7 +60,7 @@ export function uiIssuesInfo(context) {
|
||||
|
||||
var chipSelection = d3_select(this);
|
||||
|
||||
var tooltipBehavior = tooltip()
|
||||
var tooltipBehavior = uiTooltip()
|
||||
.placement('top')
|
||||
.title(t(d.descriptionID));
|
||||
|
||||
|
||||
+2
-2
@@ -5,7 +5,7 @@ import {
|
||||
|
||||
import { svgIcon } from '../svg/icon';
|
||||
import { textDirection } from '../util/locale';
|
||||
import { tooltip } from '../util/tooltip';
|
||||
import { uiTooltip } from './tooltip';
|
||||
import { uiTooltipHtml } from './tooltipHtml';
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ export function uiPane(id, context) {
|
||||
pane.renderToggleButton = function(selection) {
|
||||
|
||||
if (!_paneTooltip) {
|
||||
_paneTooltip = tooltip()
|
||||
_paneTooltip = uiTooltip()
|
||||
.placement((textDirection === 'rtl') ? 'right' : 'left')
|
||||
.html(true)
|
||||
.title(uiTooltipHtml(_description, _key));
|
||||
|
||||
@@ -8,7 +8,7 @@ import { uiTooltipHtml } from '../tooltipHtml';
|
||||
import { uiPane } from '../pane';
|
||||
|
||||
import { t, textDirection } from '../../util/locale';
|
||||
import { tooltip } from '../../util/tooltip';
|
||||
import { uiTooltip } from '../tooltip';
|
||||
import { icon } from '../intro/helper';
|
||||
|
||||
export function uiPaneHelp(context) {
|
||||
@@ -364,7 +364,7 @@ export function uiPaneHelp(context) {
|
||||
var shortcuts = toc
|
||||
.append('li')
|
||||
.attr('class', 'shortcuts')
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.html(true)
|
||||
.title(uiTooltipHtml(t('shortcuts.tooltip'), '?'))
|
||||
.placement('top')
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { event as d3_event, select as d3_select } from 'd3-selection';
|
||||
import { utilFunctor } from './util';
|
||||
import { utilFunctor } from '../util/util';
|
||||
|
||||
var _popoverID = 0;
|
||||
|
||||
export function popover(klass) {
|
||||
export function uiPopover(klass) {
|
||||
var _id = _popoverID++;
|
||||
var _anchorSelection = d3_select(null);
|
||||
var popover = function(selection) {
|
||||
@@ -10,7 +10,7 @@ import { t, textDirection } from '../util/locale';
|
||||
import { actionChangePreset } from '../actions/change_preset';
|
||||
import { operationDelete } from '../operations/delete';
|
||||
import { svgIcon } from '../svg/index';
|
||||
import { tooltip } from '../util/tooltip';
|
||||
import { uiTooltip } from './tooltip';
|
||||
import { geoExtent } from '../geo/extent';
|
||||
import { uiPresetIcon } from './preset_icon';
|
||||
import { uiTagReference } from './tag_reference';
|
||||
@@ -436,7 +436,7 @@ export function uiPresetList(context) {
|
||||
var button = context.container().selectAll('.preset-list .preset-list-button');
|
||||
|
||||
// remove existing tooltips
|
||||
button.call(tooltip().destroyAny);
|
||||
button.call(uiTooltip().destroyAny);
|
||||
|
||||
button.each(function(item, index) {
|
||||
var hiddenPresetFeaturesId;
|
||||
@@ -455,7 +455,7 @@ export function uiPresetList(context) {
|
||||
var isAutoHidden = context.features().autoHidden(hiddenPresetFeaturesId);
|
||||
var tooltipIdSuffix = isAutoHidden ? 'zoom' : 'manual';
|
||||
var tooltipObj = { features: t('feature.' + hiddenPresetFeaturesId + '.description') };
|
||||
d3_select(this).call(tooltip()
|
||||
d3_select(this).call(uiTooltip()
|
||||
.title(t('inspector.hidden_preset.' + tooltipIdSuffix, tooltipObj))
|
||||
.placement(index < 2 ? 'bottom' : 'top')
|
||||
);
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
} from 'd3-selection';
|
||||
|
||||
import { t, textDirection } from '../../util/locale';
|
||||
import { tooltip } from '../../util/tooltip';
|
||||
import { uiTooltip } from '../tooltip';
|
||||
import { svgIcon } from '../../svg/icon';
|
||||
import { uiCmd } from '../cmd';
|
||||
import { uiSettingsCustomBackground } from '../settings/custom_background';
|
||||
@@ -55,7 +55,7 @@ export function uiSectionBackgroundList(context) {
|
||||
.append('li')
|
||||
.attr('class', 'minimap-toggle-item')
|
||||
.append('label')
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.html(true)
|
||||
.title(uiTooltipHtml(t('background.minimap.tooltip'), t('background.minimap.key')))
|
||||
.placement('top')
|
||||
@@ -78,7 +78,7 @@ export function uiSectionBackgroundList(context) {
|
||||
.append('li')
|
||||
.attr('class', 'background-panel-toggle-item')
|
||||
.append('label')
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.html(true)
|
||||
.title(uiTooltipHtml(t('background.panel.tooltip'), uiCmd('⌘⇧' + t('info_panels.background.key'))))
|
||||
.placement('top')
|
||||
@@ -122,10 +122,10 @@ export function uiSectionBackgroundList(context) {
|
||||
var description = d.description();
|
||||
var isOverflowing = (span.property('clientWidth') !== span.property('scrollWidth'));
|
||||
|
||||
item.call(tooltip().destroyAny);
|
||||
item.call(uiTooltip().destroyAny);
|
||||
|
||||
if (d.id === previousBackgroundID()) {
|
||||
item.call(tooltip()
|
||||
item.call(uiTooltip()
|
||||
.placement(placement)
|
||||
.html(true)
|
||||
.title(function() {
|
||||
@@ -134,7 +134,7 @@ export function uiSectionBackgroundList(context) {
|
||||
})
|
||||
);
|
||||
} else if (description || isOverflowing) {
|
||||
item.call(tooltip()
|
||||
item.call(uiTooltip()
|
||||
.placement(placement)
|
||||
.title(description || d.name())
|
||||
);
|
||||
@@ -174,7 +174,7 @@ export function uiSectionBackgroundList(context) {
|
||||
enter.filter(function(d) { return d.id === 'custom'; })
|
||||
.append('button')
|
||||
.attr('class', 'layer-browse')
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.title(t('settings.custom_background.tooltip'))
|
||||
.placement((textDirection === 'rtl') ? 'right' : 'left')
|
||||
)
|
||||
@@ -184,7 +184,7 @@ export function uiSectionBackgroundList(context) {
|
||||
enter.filter(function(d) { return d.best(); })
|
||||
.append('div')
|
||||
.attr('class', 'best')
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.title(t('background.best_imagery'))
|
||||
.placement((textDirection === 'rtl') ? 'right' : 'left')
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
} from 'd3-selection';
|
||||
|
||||
import { t, textDirection } from '../../util/locale';
|
||||
import { tooltip } from '../../util/tooltip';
|
||||
import { uiTooltip } from '../tooltip';
|
||||
import { svgIcon } from '../../svg/icon';
|
||||
import { geoExtent } from '../../geo';
|
||||
import { modeBrowse } from '../../modes/browse';
|
||||
@@ -94,14 +94,14 @@ export function uiSectionDataLayers(context) {
|
||||
.each(function(d) {
|
||||
if (d.id === 'osm') {
|
||||
d3_select(this)
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.html(true)
|
||||
.title(uiTooltipHtml(t('map_data.layers.' + d.id + '.tooltip'), uiCmd('⌥' + t('area_fill.wireframe.key'))))
|
||||
.placement('bottom')
|
||||
);
|
||||
} else {
|
||||
d3_select(this)
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.title(t('map_data.layers.' + d.id + '.tooltip'))
|
||||
.placement('bottom')
|
||||
);
|
||||
@@ -153,7 +153,7 @@ export function uiSectionDataLayers(context) {
|
||||
.append('label')
|
||||
.each(function(d) {
|
||||
d3_select(this)
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.title(t('map_data.layers.' + d.id + '.tooltip'))
|
||||
.placement('bottom')
|
||||
);
|
||||
@@ -254,7 +254,7 @@ export function uiSectionDataLayers(context) {
|
||||
.append('label')
|
||||
.each(function(d) {
|
||||
d3_select(this).call(
|
||||
tooltip().title(d.tooltip).placement('top')
|
||||
uiTooltip().title(d.tooltip).placement('top')
|
||||
);
|
||||
});
|
||||
|
||||
@@ -313,7 +313,7 @@ export function uiSectionDataLayers(context) {
|
||||
|
||||
var labelEnter = liEnter
|
||||
.append('label')
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.title(t('map_data.layers.custom.tooltip'))
|
||||
.placement('top')
|
||||
);
|
||||
@@ -329,7 +329,7 @@ export function uiSectionDataLayers(context) {
|
||||
|
||||
liEnter
|
||||
.append('button')
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.title(t('settings.custom_data.tooltip'))
|
||||
.placement((textDirection === 'rtl') ? 'right' : 'left')
|
||||
)
|
||||
@@ -338,7 +338,7 @@ export function uiSectionDataLayers(context) {
|
||||
|
||||
liEnter
|
||||
.append('button')
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.title(t('map_data.layers.custom.zoom'))
|
||||
.placement((textDirection === 'rtl') ? 'right' : 'left')
|
||||
)
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
|
||||
import { utilArrayIdentical } from '../../util/array';
|
||||
import { t } from '../../util/locale';
|
||||
import { tooltip } from '../../util/tooltip';
|
||||
import { uiTooltip } from '../tooltip';
|
||||
import { utilRebind } from '../../util';
|
||||
import { uiPresetIcon } from '../preset_icon';
|
||||
import { uiSection } from '../section';
|
||||
@@ -40,7 +40,7 @@ export function uiSectionFeatureType(context) {
|
||||
var presetButton = presetButtonWrap
|
||||
.append('button')
|
||||
.attr('class', 'preset-list-button preset-reset')
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.title(t('inspector.back_tooltip'))
|
||||
.placement('bottom')
|
||||
);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { t } from '../../util/locale';
|
||||
import { tooltip } from '../../util/tooltip';
|
||||
import { uiTooltip } from '../tooltip';
|
||||
import { uiSection } from '../section';
|
||||
import { uiTooltipHtml } from '../tooltipHtml';
|
||||
|
||||
@@ -66,7 +66,7 @@ export function uiSectionMapFeatures(context) {
|
||||
// Enter
|
||||
var enter = items.enter()
|
||||
.append('li')
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.html(true)
|
||||
.title(function(d) {
|
||||
var tip = t(name + '.' + d + '.tooltip');
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
} from 'd3-selection';
|
||||
|
||||
import { t } from '../../util/locale';
|
||||
import { tooltip } from '../../util/tooltip';
|
||||
import { uiTooltip } from '../tooltip';
|
||||
import { uiSection } from '../section';
|
||||
import { uiTooltipHtml } from '../tooltipHtml';
|
||||
|
||||
@@ -47,7 +47,7 @@ export function uiSectionMapStyleOptions(context) {
|
||||
// Enter
|
||||
var enter = items.enter()
|
||||
.append('li')
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.html(true)
|
||||
.title(function(d) {
|
||||
var tip = t(name + '.' + d + '.tooltip');
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
} from 'd3-selection';
|
||||
|
||||
import { t } from '../../util/locale';
|
||||
import { tooltip } from '../../util/tooltip';
|
||||
import { uiTooltip } from '../tooltip';
|
||||
import { uiSection } from '../section';
|
||||
|
||||
export function uiSectionOverlayList(context) {
|
||||
@@ -25,10 +25,10 @@ export function uiSectionOverlayList(context) {
|
||||
var description = d.description();
|
||||
var isOverflowing = (span.property('clientWidth') !== span.property('scrollWidth'));
|
||||
|
||||
item.call(tooltip().destroyAny);
|
||||
item.call(uiTooltip().destroyAny);
|
||||
|
||||
if (description || isOverflowing) {
|
||||
item.call(tooltip()
|
||||
item.call(uiTooltip()
|
||||
.placement(placement)
|
||||
.title(description || d.name())
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
} from 'd3-selection';
|
||||
|
||||
import { t } from '../../util/locale';
|
||||
import { tooltip } from '../../util/tooltip';
|
||||
import { uiTooltip } from '../tooltip';
|
||||
import { svgIcon } from '../../svg/icon';
|
||||
import { uiSection } from '../section';
|
||||
|
||||
@@ -74,7 +74,7 @@ export function uiSectionPhotoOverlays(context) {
|
||||
else if (d.id === 'openstreetcam') titleID = 'openstreetcam_images.tooltip';
|
||||
else titleID = d.id.replace(/-/g, '_') + '.tooltip';
|
||||
d3_select(this)
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.title(t(titleID))
|
||||
.placement('top')
|
||||
);
|
||||
@@ -148,7 +148,7 @@ export function uiSectionPhotoOverlays(context) {
|
||||
.append('label')
|
||||
.each(function(d) {
|
||||
d3_select(this)
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.title(t('photo_overlays.photo_type.' + d + '.tooltip'))
|
||||
.placement('top')
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
} from 'd3-selection';
|
||||
|
||||
import { t } from '../../util/locale';
|
||||
import { tooltip } from '../../util/tooltip';
|
||||
import { uiTooltip } from '../tooltip';
|
||||
import { svgIcon } from '../../svg/icon';
|
||||
import { uiSection } from '../section';
|
||||
|
||||
@@ -27,7 +27,7 @@ export function uiSectionPrivacy(context) {
|
||||
.append('li')
|
||||
.attr('class', 'privacy-third-party-icons-item')
|
||||
.append('label')
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.title(t('preferences.privacy.third_party_icons.tooltip'))
|
||||
.placement('bottom')
|
||||
);
|
||||
|
||||
@@ -16,7 +16,7 @@ import { services } from '../../services';
|
||||
import { svgIcon } from '../../svg/icon';
|
||||
import { uiCombobox } from '../combobox';
|
||||
import { uiSection } from '../section';
|
||||
import { tooltip } from '../../util/tooltip';
|
||||
import { uiTooltip } from '../tooltip';
|
||||
import { utilArrayGroupBy, utilDisplayName, utilNoAuto, utilHighlightEntities } from '../../util';
|
||||
|
||||
|
||||
@@ -345,7 +345,7 @@ export function uiSectionRawMembershipEditor(context) {
|
||||
addRelationButton
|
||||
.call(svgIcon('#iD-icon-plus', 'light'));
|
||||
addRelationButton
|
||||
.call(tooltip().title(t('inspector.add_to_relation')).placement(textDirection === 'ltr' ? 'right' : 'left'));
|
||||
.call(uiTooltip().title(t('inspector.add_to_relation')).placement(textDirection === 'ltr' ? 'right' : 'left'));
|
||||
|
||||
addRowEnter
|
||||
.append('div')
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
|
||||
import { t } from '../../util/locale';
|
||||
import { utilGetSetValue, utilNoAuto } from '../../util';
|
||||
import { tooltip } from '../../util/tooltip';
|
||||
import { uiTooltip } from '../tooltip';
|
||||
import { uiSection } from '../section';
|
||||
|
||||
export function uiSectionValidationRules(context) {
|
||||
@@ -82,7 +82,7 @@ export function uiSectionValidationRules(context) {
|
||||
|
||||
if (name === 'rule') {
|
||||
enter
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.title(function(d) { return t('issues.' + d + '.tip'); })
|
||||
.placement('top')
|
||||
);
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
|
||||
import { t } from '../../util/locale';
|
||||
import { svgIcon } from '../../svg';
|
||||
import { tooltip } from '../../util/tooltip';
|
||||
import { uiTooltip } from '../tooltip';
|
||||
import { uiTooltipHtml } from '../tooltipHtml';
|
||||
|
||||
export function uiToolOldDrawModes(context) {
|
||||
@@ -126,7 +126,7 @@ export function uiToolOldDrawModes(context) {
|
||||
context.enter(d);
|
||||
}
|
||||
})
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.placement('bottom')
|
||||
.html(true)
|
||||
.title(function(d) { return uiTooltipHtml(d.description, d.key); })
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
|
||||
import { t } from '../../util/locale';
|
||||
import { svgIcon } from '../../svg';
|
||||
import { tooltip } from '../../util/tooltip';
|
||||
import { uiTooltip } from '../tooltip';
|
||||
import { uiTooltipHtml } from '../tooltipHtml';
|
||||
|
||||
export function uiToolNotes(context) {
|
||||
@@ -103,7 +103,7 @@ export function uiToolNotes(context) {
|
||||
context.enter(d);
|
||||
}
|
||||
})
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.placement('bottom')
|
||||
.html(true)
|
||||
.title(function(d) { return uiTooltipHtml(d.description, d.key); })
|
||||
|
||||
@@ -6,7 +6,7 @@ import { modeSave } from '../../modes';
|
||||
import { svgIcon } from '../../svg';
|
||||
import { uiCmd } from '../cmd';
|
||||
import { uiTooltipHtml } from '../tooltipHtml';
|
||||
import { tooltip } from '../../util/tooltip';
|
||||
import { uiTooltip } from '../tooltip';
|
||||
|
||||
|
||||
export function uiToolSave(context) {
|
||||
@@ -76,7 +76,7 @@ export function uiToolSave(context) {
|
||||
|
||||
|
||||
tool.render = function(selection) {
|
||||
tooltipBehavior = tooltip()
|
||||
tooltipBehavior = uiTooltip()
|
||||
.placement('bottom')
|
||||
.html(true)
|
||||
.title(uiTooltipHtml(t('save.no_changes'), key))
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { t, textDirection } from '../../util/locale';
|
||||
import { svgIcon } from '../../svg';
|
||||
import { uiTooltipHtml } from '../tooltipHtml';
|
||||
import { tooltip } from '../../util/tooltip';
|
||||
import { uiTooltip } from '../tooltip';
|
||||
|
||||
export function uiToolSidebarToggle(context) {
|
||||
|
||||
@@ -17,7 +17,7 @@ export function uiToolSidebarToggle(context) {
|
||||
.on('click', function() {
|
||||
context.ui().sidebar.toggle();
|
||||
})
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.placement('bottom')
|
||||
.html(true)
|
||||
.title(uiTooltipHtml(t('sidebar.tooltip'), t('sidebar.key')))
|
||||
|
||||
@@ -9,7 +9,7 @@ import { t, textDirection } from '../../util/locale';
|
||||
import { svgIcon } from '../../svg';
|
||||
import { uiCmd } from '../cmd';
|
||||
import { uiTooltipHtml } from '../tooltipHtml';
|
||||
import { tooltip } from '../../util/tooltip';
|
||||
import { uiTooltip } from '../tooltip';
|
||||
|
||||
|
||||
export function uiToolUndoRedo(context) {
|
||||
@@ -38,7 +38,7 @@ export function uiToolUndoRedo(context) {
|
||||
|
||||
|
||||
tool.render = function(selection) {
|
||||
var tooltipBehavior = tooltip()
|
||||
var tooltipBehavior = uiTooltip()
|
||||
.placement('bottom')
|
||||
.html(true)
|
||||
.title(function (d) {
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { utilFunctor } from './util';
|
||||
import { popover } from './popover';
|
||||
import { utilFunctor } from '../util/util';
|
||||
import { uiPopover } from './popover';
|
||||
|
||||
export function tooltip(klass) {
|
||||
export function uiTooltip(klass) {
|
||||
|
||||
var tooltip = popover((klass || '') + ' tooltip')
|
||||
var tooltip = uiPopover((klass || '') + ' tooltip')
|
||||
.displayType('hover');
|
||||
|
||||
var _title = function() {
|
||||
@@ -1,6 +1,6 @@
|
||||
import { t } from '../util/locale';
|
||||
import { svgIcon } from '../svg/icon';
|
||||
import { tooltip } from '../util/tooltip';
|
||||
import { uiTooltip } from './tooltip';
|
||||
|
||||
|
||||
// these are module variables so they are preserved through a ui.restart()
|
||||
@@ -37,7 +37,7 @@ export function uiVersion(context) {
|
||||
.attr('target', '_blank')
|
||||
.attr('href', 'https://github.com/openstreetmap/iD/blob/release/CHANGELOG.md#whats-new')
|
||||
.call(svgIcon('#maki-gift-11'))
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.title(t('version.whats_new', { version: currVersion }))
|
||||
.placement('top')
|
||||
);
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ import { t, textDirection } from '../util/locale';
|
||||
import { svgIcon } from '../svg/icon';
|
||||
import { uiCmd } from './cmd';
|
||||
import { uiTooltipHtml } from './tooltipHtml';
|
||||
import { tooltip } from '../util/tooltip';
|
||||
import { uiTooltip } from './tooltip';
|
||||
|
||||
|
||||
export function uiZoom(context) {
|
||||
@@ -57,7 +57,7 @@ export function uiZoom(context) {
|
||||
d.action();
|
||||
}
|
||||
})
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.placement((textDirection === 'rtl') ? 'right' : 'left')
|
||||
.html(true)
|
||||
.title(function(d) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { select as d3_select } from 'd3-selection';
|
||||
|
||||
import { t, textDirection } from '../util/locale';
|
||||
import { tooltip } from '../util/tooltip';
|
||||
import { uiTooltip } from './tooltip';
|
||||
import { uiTooltipHtml } from './tooltipHtml';
|
||||
import { svgIcon } from '../svg/icon';
|
||||
|
||||
@@ -32,7 +32,7 @@ export function uiZoomToSelection(context) {
|
||||
.append('button')
|
||||
.on('click', click)
|
||||
.call(svgIcon('#iD-icon-framed-dot', 'light'))
|
||||
.call(tooltip()
|
||||
.call(uiTooltip()
|
||||
.placement((textDirection === 'rtl') ? 'right' : 'left')
|
||||
.html(true)
|
||||
.title(uiTooltipHtml(t('inspector.zoom_to.title'), t('inspector.zoom_to.key')))
|
||||
|
||||
Reference in New Issue
Block a user