From b5a316df48c6833b72e43162cee359679544032b Mon Sep 17 00:00:00 2001 From: Thomas Hervey Date: Thu, 9 Aug 2018 15:59:05 -0600 Subject: [PATCH] fixed: svg icon placement --- modules/svg/keepRight.js | 4 ++-- modules/ui/keepRight_details.js | 2 -- modules/ui/keepRight_header.js | 19 ++++++++++--------- svg/iD-sprite/icons/icon-bolt.svg | 7 +++++-- 4 files changed, 17 insertions(+), 15 deletions(-) diff --git a/modules/svg/keepRight.js b/modules/svg/keepRight.js index 4692f616e..fc84d7677 100644 --- a/modules/svg/keepRight.js +++ b/modules/svg/keepRight.js @@ -144,8 +144,8 @@ export function svgKeepRight(projection, context, dispatch) { .attr('class', 'kr_error-fill') .attr('width', '20px') .attr('height', '20px') - .attr('x', '-4px') - .attr('y', '-24px') + .attr('x', '-8px') + .attr('y', '-22px') .attr('xlink:href', '#iD-icon-bolt'); // update diff --git a/modules/ui/keepRight_details.js b/modules/ui/keepRight_details.js index 4c1dfd4cc..34620a5d0 100644 --- a/modules/ui/keepRight_details.js +++ b/modules/ui/keepRight_details.js @@ -12,8 +12,6 @@ export function uiKeepRightDetails(context) { var _parent_error_type = ''; var _titleBase; - var _links; - function initDetails() { if (errorTypes.errors['_' + _error.error_type]) { diff --git a/modules/ui/keepRight_header.js b/modules/ui/keepRight_header.js index 836388a30..f9a9e021d 100644 --- a/modules/ui/keepRight_header.js +++ b/modules/ui/keepRight_header.js @@ -9,17 +9,17 @@ export function uiKeepRightHeader(context) { var _error; - function clickLink() { + function clickLink(datum) { var d = {}; var entityType = - _error.object_type === 'node' ? 'n' : - _error.object_type === 'way' ? 'w' : - _error.object_type === 'relation' ? 'r' : null; + datum.object_type === 'node' ? 'n' : + datum.object_type === 'way' ? 'w' : + datum.object_type === 'relation' ? 'r' : null; // if an entity has been loaded in the graph, select the entity - if (context.hasEntity(entityType + _error.object_id)) { - d = context.hasEntity(entityType + _error.object_id); + if (context.hasEntity(entityType + datum.object_id)) { + d = context.hasEntity(entityType + datum.object_id); } d3_event.preventDefault(); @@ -36,8 +36,9 @@ export function uiKeepRightHeader(context) { } context.enter(modeSelect(context, [d.entity.id])); } else { - // TODO: turn on osm layer - context.zoomToEntity(d.id); + context.layers().layer('osm').enabled(true); + context.zoomToEntity(entityType + datum.object_id); + // TODO: select entity that has been zoomed to } } @@ -76,7 +77,7 @@ export function uiKeepRightHeader(context) { .append('span') .append('a') .text(function(d) { return d.object_id; }) - .on('click', clickLink); + .on('click', function(d) { clickLink(d); } ); } diff --git a/svg/iD-sprite/icons/icon-bolt.svg b/svg/iD-sprite/icons/icon-bolt.svg index 129fa8ac7..6eb402946 100644 --- a/svg/iD-sprite/icons/icon-bolt.svg +++ b/svg/iD-sprite/icons/icon-bolt.svg @@ -1,6 +1,9 @@ - + + + +