From 018e7f207e1797c560d3561f0aedbe87fc06511d Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Tue, 26 Jul 2016 15:51:09 -0400 Subject: [PATCH] Wrap selection list geometry icon in a span This is important so d3 update selection can select the geometry icon but not the close icon. --- modules/ui/selection_list.js | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/modules/ui/selection_list.js b/modules/ui/selection_list.js index 29f9177ba..a0d3ba80b 100644 --- a/modules/ui/selection_list.js +++ b/modules/ui/selection_list.js @@ -51,7 +51,10 @@ export function SelectionList(context, selectedIDs) { // Enter var label = enter.append('div') - .attr('class', 'label') + .attr('class', 'label'); + + label.append('span') + .attr('class', 'entity-geom-icon') .call(Icon('', 'pre-text')); label.append('span') @@ -60,8 +63,13 @@ export function SelectionList(context, selectedIDs) { label.append('span') .attr('class', 'entity-name'); + label.append('span') + .attr('class', 'close') + .on('click', deselectEntity) + .call(Icon('#icon-close')); + // Update - items.selectAll('use') + items.selectAll('.entity-geom-icon use') .attr('href', function() { var entity = this.parentNode.parentNode.__data__; return '#icon-' + context.geometry(entity.id); @@ -73,11 +81,6 @@ export function SelectionList(context, selectedIDs) { items.selectAll('.entity-name') .text(function(entity) { return displayName(entity); }); - label.append('span') - .attr('class', 'close') - .on('click', deselectEntity) - .call(Icon('#icon-close')); - // Exit items.exit() .remove();