From cde4caf168405418d1567921be8d7871b645e6da Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Sat, 11 Aug 2018 01:18:30 -0400 Subject: [PATCH] Moved the custom background code into ui/settings We are going to add a bunch more of these setting screens --- modules/index.js | 1 + modules/ui/background.js | 7 +++---- modules/ui/index.js | 1 - modules/ui/{custom.js => settings/custom_background.js} | 8 ++++---- modules/ui/settings/index.js | 1 + 5 files changed, 9 insertions(+), 9 deletions(-) rename modules/ui/{custom.js => settings/custom_background.js} (91%) create mode 100644 modules/ui/settings/index.js diff --git a/modules/index.js b/modules/index.js index dcd7f276e..da0e95a1e 100644 --- a/modules/index.js +++ b/modules/index.js @@ -15,6 +15,7 @@ export * from './svg/index'; export * from './ui/fields/index'; export * from './ui/intro/index'; export * from './ui/panels/index'; +export * from './ui/settings/index'; export * from './ui/index'; export * from './util/index'; export * from './lib/index'; diff --git a/modules/ui/background.js b/modules/ui/background.js index 00e2a9b01..ea33ef94f 100644 --- a/modules/ui/background.js +++ b/modules/ui/background.js @@ -17,12 +17,12 @@ import { svgIcon } from '../svg'; import { uiBackgroundDisplayOptions } from './background_display_options'; import { uiBackgroundOffset } from './background_offset'; import { uiCmd } from './cmd'; -import { uiCustom } from './custom'; import { uiDisclosure } from './disclosure'; import { uiHelp } from './help'; import { uiMapData } from './map_data'; import { uiMapInMap } from './map_in_map'; import { uiModal } from './modal'; +import { uiSettingsCustomBackground } from './settings/custom_background'; import { uiTooltipHtml } from './tooltipHtml'; import { utilCallWhenIdle } from '../util'; import { tooltip } from '../util/tooltip'; @@ -90,7 +90,6 @@ export function uiBackground(context) { function chooseBackground(d) { if (d.id === 'custom' && !d.template()) { return editCustom(); - } d3_event.preventDefault(); @@ -116,7 +115,7 @@ export function uiBackground(context) { d3_event.preventDefault(); context.container() - .call(uiCustom(context)); + .call(uiSettingsCustomBackground(context)); } @@ -153,7 +152,7 @@ export function uiBackground(context) { .placement((textDirection === 'rtl') ? 'right' : 'left') ) .on('click', editCustom) - .call(svgIcon('#iD-icon-edit')); + .call(svgIcon('#iD-icon-more')); enter.filter(function(d) { return d.best(); }) .append('div') diff --git a/modules/ui/index.js b/modules/ui/index.js index d82ddeca1..35d9a8517 100644 --- a/modules/ui/index.js +++ b/modules/ui/index.js @@ -11,7 +11,6 @@ export { uiCommitChanges } from './commit_changes'; export { uiCommitWarnings } from './commit_warnings'; export { uiConfirm } from './confirm'; export { uiConflicts } from './conflicts'; -export { uiCustom } from './custom'; export { uiContributors } from './contributors'; export { uiCurtain } from './curtain'; export { uiDisclosure } from './disclosure'; diff --git a/modules/ui/custom.js b/modules/ui/settings/custom_background.js similarity index 91% rename from modules/ui/custom.js rename to modules/ui/settings/custom_background.js index e85e5b92f..9e9f51478 100644 --- a/modules/ui/custom.js +++ b/modules/ui/settings/custom_background.js @@ -1,9 +1,9 @@ -import { t } from '../util/locale'; -import { uiBackground } from './background'; -import { uiModal } from './modal'; +import { t } from '../../util/locale'; +import { uiBackground } from '../background'; +import { uiModal } from '../modal'; -export function uiCustom(context) { +export function uiSettingsCustomBackground(context) { return function(selection) { diff --git a/modules/ui/settings/index.js b/modules/ui/settings/index.js new file mode 100644 index 000000000..52579d5d5 --- /dev/null +++ b/modules/ui/settings/index.js @@ -0,0 +1 @@ +export { uiSettingsCustomBackground } from './custom_background';