mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-18 22:48:10 +02:00
Honor the user's third party icon preference
This commit is contained in:
@@ -10,7 +10,7 @@ import { uiTooltipHtml } from './tooltipHtml';
|
||||
export function uiPreferences(context) {
|
||||
const key = t('preferences.key');
|
||||
let _pane = d3_select(null);
|
||||
let _showThirdPartyIcons = context.storage('preferences.privacy.thirdpartyicons') || true;
|
||||
let _showThirdPartyIcons = context.storage('preferences.privacy.thirdpartyicons') || 'true';
|
||||
|
||||
const paneTooltip = tooltip()
|
||||
.placement((textDirection === 'rtl') ? 'right' : 'left')
|
||||
@@ -40,7 +40,7 @@ export function uiPreferences(context) {
|
||||
.attr('type', 'checkbox')
|
||||
.on('change', () => {
|
||||
d3_event.preventDefault();
|
||||
_showThirdPartyIcons = !_showThirdPartyIcons;
|
||||
_showThirdPartyIcons = (_showThirdPartyIcons === 'true') ? 'false' : 'true';
|
||||
context.storage('preferences.privacy.thirdpartyicons', _showThirdPartyIcons);
|
||||
update();
|
||||
});
|
||||
@@ -68,9 +68,9 @@ export function uiPreferences(context) {
|
||||
|
||||
function update() {
|
||||
selection.selectAll('.privacy-third-party-icons-item')
|
||||
.classed('active', _showThirdPartyIcons)
|
||||
.classed('active', (_showThirdPartyIcons === 'true'))
|
||||
.select('input')
|
||||
.property('checked', _showThirdPartyIcons);
|
||||
.property('checked', (_showThirdPartyIcons === 'true'));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -231,8 +231,10 @@ export function uiPresetIcon(context) {
|
||||
if (geom === 'relation' && p.tags && ((p.tags.type === 'route' && p.tags.route && routeSegments[p.tags.route]) || p.tags.type === 'waterway')) {
|
||||
geom = 'route';
|
||||
}
|
||||
|
||||
const showThirdPartyIcons = context.storage('preferences.privacy.thirdpartyicons') || 'true';
|
||||
const isFallback = isSmall() && p.isFallback && p.isFallback();
|
||||
const imageURL = p.imageURL;
|
||||
const imageURL = (showThirdPartyIcons === 'true') && p.imageURL;
|
||||
const picon = getIcon(p, geom);
|
||||
const isMaki = picon && /^maki-/.test(picon);
|
||||
const isTemaki = picon && /^temaki-/.test(picon);
|
||||
|
||||
Reference in New Issue
Block a user