mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-18 22:48:10 +02:00
Fix imagery layers resetting eachother's classes
Fixes: - Selecting a bubble then enabling a second imagery layer removes the hovered and selected highlighting - If multiple imagery layers are enabled and you select a bubble it only temporarily becomes highlighted - If multiple imagery layers are enabled and a bubble is highlighted, hovering over another imagery layer's bubble will remove the selected and hovered highlighting Basically these all came down to style updates resetting all layers for cases other than when the viewport was changed (where doing so makes sense because the selected bubble/sequence needs to update as a result). See #5494
This commit is contained in:
@@ -556,6 +556,9 @@ export default {
|
||||
},
|
||||
|
||||
|
||||
// Updates the currently highlighted sequence and selected bubble.
|
||||
// Reset is only necessary when interacting with the viewport because
|
||||
// this implicitly changes the currently selected bubble/sequence
|
||||
setStyles: function(hovered, reset) {
|
||||
if (reset) { // reset all layers
|
||||
d3_selectAll('.viewfield-group')
|
||||
|
||||
@@ -492,6 +492,9 @@ export default {
|
||||
},
|
||||
|
||||
|
||||
// Updates the currently highlighted sequence and selected bubble.
|
||||
// Reset is only necessary when interacting with the viewport because
|
||||
// this implicitly changes the currently selected bubble/sequence
|
||||
setStyles: function(hovered, reset) {
|
||||
if (reset) { // reset all layers
|
||||
d3_selectAll('.viewfield-group')
|
||||
|
||||
@@ -925,9 +925,9 @@ export default {
|
||||
},
|
||||
|
||||
|
||||
/**
|
||||
* setStyles().
|
||||
*/
|
||||
// Updates the currently highlighted sequence and selected bubble.
|
||||
// Reset is only necessary when interacting with the viewport because
|
||||
// this implicitly changes the currently selected bubble/sequence
|
||||
setStyles: function (hovered, reset) {
|
||||
if (reset) { // reset all layers
|
||||
d3_selectAll('.viewfield-group')
|
||||
|
||||
@@ -205,6 +205,7 @@ export function svgMapillaryImages(projection, context, dispatch) {
|
||||
.attr('transform', 'scale(1.5,1.5),translate(-8, -13)')
|
||||
.attr('d', viewfieldPath);
|
||||
|
||||
|
||||
function viewfieldPath() {
|
||||
var d = this.parentNode.__data__;
|
||||
if (d.pano) {
|
||||
|
||||
@@ -122,7 +122,7 @@ export function svgStreetside(projection, context, dispatch) {
|
||||
function mouseover(d) {
|
||||
var service = getService();
|
||||
_hoveredBubble = d;
|
||||
if (service) service.setStyles(d, true);
|
||||
if (service) service.setStyles(d);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -131,7 +131,7 @@ export function svgStreetside(projection, context, dispatch) {
|
||||
function mouseout() {
|
||||
var service = getService();
|
||||
_hoveredBubble = null;
|
||||
if (service) service.setStyles(null, true);
|
||||
if (service) service.setStyles(null);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -253,7 +253,7 @@ export function svgStreetside(projection, context, dispatch) {
|
||||
|
||||
|
||||
if (service) {
|
||||
service.setStyles(_hoveredBubble, true);
|
||||
service.setStyles(_hoveredBubble);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user