From 947f9657db91aeca271f5bbeef2fc481beb025f0 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sat, 7 Dec 2019 19:21:23 +0000 Subject: [PATCH] Port minor QoL tweaks to other QA services Use of MouseEnter and MouseLeave is nicer for SVGs since it won't fire multiple times (shouldn't happen hear anyway as only one element). Triggering redraw after forcing related elements visible causes them to render without having to pan manually. --- modules/ui/improveOSM_details.js | 7 ++++--- modules/ui/keepRight_details.js | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/ui/improveOSM_details.js b/modules/ui/improveOSM_details.js index c7d33a076..435c09c51 100644 --- a/modules/ui/improveOSM_details.js +++ b/modules/ui/improveOSM_details.js @@ -78,11 +78,11 @@ export function uiImproveOsmDetails(context) { // Add click handler link - .on('mouseover', function() { + .on('mouseenter', function() { context.surface().selectAll(utilEntityOrMemberSelector([entityID], context.graph())) .classed('hover', true); }) - .on('mouseout', function() { + .on('mouseleave', function() { context.surface().selectAll('.hover') .classed('hover', false); }) @@ -122,6 +122,7 @@ export function uiImproveOsmDetails(context) { // Don't hide entities related to this error - #5880 context.features().forceVisible(relatedEntities); + context.map().pan([0,0]); // trigger a redraw } @@ -133,4 +134,4 @@ export function uiImproveOsmDetails(context) { return improveOsmDetails; -} +} \ No newline at end of file diff --git a/modules/ui/keepRight_details.js b/modules/ui/keepRight_details.js index c292bf0ae..966e75f0e 100644 --- a/modules/ui/keepRight_details.js +++ b/modules/ui/keepRight_details.js @@ -80,11 +80,11 @@ export function uiKeepRightDetails(context) { // Add click handler link - .on('mouseover', function() { + .on('mouseenter', function() { context.surface().selectAll(utilEntityOrMemberSelector([entityID], context.graph())) .classed('hover', true); }) - .on('mouseout', function() { + .on('mouseleave', function() { context.surface().selectAll('.hover') .classed('hover', false); }) @@ -124,6 +124,7 @@ export function uiKeepRightDetails(context) { // Don't hide entities related to this error - #5880 context.features().forceVisible(relatedEntities); + context.map().pan([0,0]); // trigger a redraw } @@ -135,4 +136,4 @@ export function uiKeepRightDetails(context) { return keepRightDetails; -} +} \ No newline at end of file