mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-21 07:46:58 +02:00
Add browser-polyfills, remove lodash assign, compact, values
(re: #6087)
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
import _compact from 'lodash-es/compact';
|
||||
import _map from 'lodash-es/map';
|
||||
|
||||
import { event as d3_event } from 'd3-selection';
|
||||
|
||||
import { t } from '../util/locale';
|
||||
@@ -10,15 +7,15 @@ import { tooltip } from '../util/tooltip';
|
||||
|
||||
export function uiFeatureInfo(context) {
|
||||
function update(selection) {
|
||||
var features = context.features(),
|
||||
stats = features.stats(),
|
||||
count = 0,
|
||||
hiddenList = _compact(_map(features.hidden(), function(k) {
|
||||
if (stats[k]) {
|
||||
count += stats[k];
|
||||
return String(stats[k]) + ' ' + t('feature.' + k + '.description');
|
||||
}
|
||||
}));
|
||||
var features = context.features();
|
||||
var stats = features.stats();
|
||||
var count = 0;
|
||||
var hiddenList = features.hidden().map(function(k) {
|
||||
if (stats[k]) {
|
||||
count += stats[k];
|
||||
return String(stats[k]) + ' ' + t('feature.' + k + '.description');
|
||||
}
|
||||
}).filter(Boolean);
|
||||
|
||||
selection.html('');
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import _difference from 'lodash-es/difference';
|
||||
import _uniq from 'lodash-es/uniq';
|
||||
import _values from 'lodash-es/values';
|
||||
|
||||
import {
|
||||
select as d3_select,
|
||||
@@ -86,7 +85,7 @@ export function uiIntro(context) {
|
||||
// Load semi-real data used in intro
|
||||
if (osm) { osm.toggle(false).reset(); }
|
||||
context.history().reset();
|
||||
context.history().merge(_values(coreGraph().load(introGraph).entities));
|
||||
context.history().merge(Object.values(coreGraph().load(introGraph).entities));
|
||||
context.history().checkpoint('initial');
|
||||
|
||||
// Setup imagery
|
||||
@@ -165,7 +164,7 @@ export function uiIntro(context) {
|
||||
d3_selectAll('#map .layer-background').style('opacity', opacity);
|
||||
d3_selectAll('button.sidebar-toggle').classed('disabled', false);
|
||||
if (osm) { osm.toggle(true).reset().caches(caches); }
|
||||
context.history().reset().merge(_values(baseEntities));
|
||||
context.history().reset().merge(Object.values(baseEntities));
|
||||
context.background().baseLayerSource(background);
|
||||
overlays.forEach(function(d) { context.background().toggleOverlayLayer(d); });
|
||||
if (history) { context.history().fromJSON(history, false); }
|
||||
|
||||
Reference in New Issue
Block a user