mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-15 05:30:35 +02:00
Use standard hover-highlighting mechanism in feature search results list
This commit is contained in:
@@ -18,7 +18,7 @@ import { uiCmd } from './cmd';
|
||||
import {
|
||||
utilDisplayName,
|
||||
utilDisplayType,
|
||||
utilEntityOrMemberSelector,
|
||||
utilHighlightEntities,
|
||||
utilNoAuto
|
||||
} from '../util';
|
||||
|
||||
@@ -153,7 +153,7 @@ export function uiFeatureList(context) {
|
||||
|
||||
var name = utilDisplayName(entity) || '';
|
||||
if (name.toLowerCase().indexOf(q) < 0) continue;
|
||||
|
||||
|
||||
var matched = context.presets().match(entity, graph);
|
||||
var type = (matched && matched.name()) || utilDisplayType(entity.id);
|
||||
var extent = entity.extent(graph);
|
||||
@@ -321,19 +321,20 @@ export function uiFeatureList(context) {
|
||||
function mouseover(d) {
|
||||
if (d.id === -1) return;
|
||||
|
||||
context.surface().selectAll(utilEntityOrMemberSelector([d.id], context.graph()))
|
||||
.classed('hover', true);
|
||||
utilHighlightEntities([d.id], true, context);
|
||||
}
|
||||
|
||||
|
||||
function mouseout() {
|
||||
context.surface().selectAll('.hover')
|
||||
.classed('hover', false);
|
||||
function mouseout(d) {
|
||||
utilHighlightEntities([d.id], false, context);
|
||||
}
|
||||
|
||||
|
||||
function click(d) {
|
||||
d3_event.preventDefault();
|
||||
|
||||
utilHighlightEntities([d.id], false, context);
|
||||
|
||||
if (d.location) {
|
||||
context.map().centerZoomEase([d.location[1], d.location[0]], 19);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user