mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-19 23:14:47 +02:00
Reduce circular dependencies caused by importing from indexes, the location of the validation models, and the location of areaKeys (close #6237)
This commit is contained in:
@@ -6,6 +6,8 @@ import { select as d3_select } from 'd3-selection';
|
||||
|
||||
import { t, currentLocale, addTranslation, setLocale } from '../util/locale';
|
||||
|
||||
import { setAreaKeys } from './area_keys';
|
||||
|
||||
import { coreHistory } from './history';
|
||||
import { coreValidator } from './validator';
|
||||
import { dataLocales, dataEn } from '../../data';
|
||||
@@ -19,13 +21,6 @@ import { utilDetect } from '../util/detect';
|
||||
import { utilCallWhenIdle, utilKeybinding, utilRebind, utilStringQs } from '../util';
|
||||
|
||||
|
||||
export var areaKeys = {};
|
||||
|
||||
export function setAreaKeys(value) {
|
||||
areaKeys = value;
|
||||
}
|
||||
|
||||
|
||||
export function coreContext() {
|
||||
var dispatch = d3_dispatch('enter', 'exit', 'change');
|
||||
var context = utilRebind({}, dispatch, 'on');
|
||||
@@ -554,11 +549,11 @@ export function coreContext() {
|
||||
var external = utilStringQs(window.location.hash).presets;
|
||||
presets.fromExternal(external, function(externalPresets) {
|
||||
context.presets = function() { return externalPresets; }; // default + external presets...
|
||||
areaKeys = presets.areaKeys();
|
||||
setAreaKeys(presets.areaKeys());
|
||||
});
|
||||
} else {
|
||||
presets.init();
|
||||
areaKeys = presets.areaKeys();
|
||||
setAreaKeys(presets.areaKeys());
|
||||
}
|
||||
|
||||
return context;
|
||||
|
||||
Reference in New Issue
Block a user