Files
iD/js/id/ui/feature_info.js
Bryan Housel 224db06ca4 design enhancements..
* replace full width bottom bar with subtle list item
* move hidden feature details to list item tooltip
* simplify some of the text labels on the Map Data panel
* progressively hide some footer elements with media queries
2014-10-31 10:55:00 -04:00

46 lines
1.4 KiB
JavaScript

iD.ui.FeatureInfo = function(context) {
function update(selection) {
var features = context.features(),
hidden = features.hidden();
selection.html('');
if (hidden.length) {
var stats = features.stats(),
count = 0,
hiddenList = _.map(hidden, function(k) {
count += stats[k];
return String(stats[k]) + ' ' + t('feature.' + k + '.description');
}),
tooltip = bootstrap.tooltip()
.placement('top')
.html(true)
.title(function() {
return iD.ui.tooltipHtml(hiddenList.join('<br/>'));
});
var warning = selection.append('a')
.attr('href', '#')
.attr('tabindex', -1)
.html(t('feature_info.hidden_warning', { count: count }))
.call(tooltip)
.on('click', function() {
tooltip.hide(warning);
// open map data panel?
d3.event.preventDefault();
});
}
selection
.classed('hide', !hidden.length);
}
return function(selection) {
update(selection);
context.features().on('change.feature_info', function() {
update(selection);
});
};
};