Fix issue where hover-highlighting wouldn't disappear upon removing a relation from a member or a member from a relation (close #5612)

This commit is contained in:
Quincy Morgan
2019-04-04 17:56:01 -07:00
parent 35c7cbd92b
commit a054db6472
2 changed files with 14 additions and 12 deletions

View File

@@ -69,6 +69,10 @@ export function uiRawMemberEditor(context) {
function deleteMember(d) {
// remove the hover-highlight styling
utilHighlightEntities([d.id], false, context);
context.perform(
actionDeleteMember(d.relation.id, d.index),
t('operations.delete_member.annotation')
@@ -77,8 +81,6 @@ export function uiRawMemberEditor(context) {
if (!context.hasEntity(d.relation.id)) {
context.enter(modeBrowse(context));
}
utilHighlightEntities([d.id], false, context);
}

View File

@@ -87,6 +87,9 @@ export function uiRawMembershipEditor(context) {
this.blur(); // avoid keeping focus on the button
if (d === 0) return; // called on newrow (shoudn't happen)
// remove the hover-highlight styling
utilHighlightEntities([d.relation.id], false, context);
context.perform(
actionDeleteMember(d.relation.id, d.index),
t('operations.delete_member.annotation')
@@ -184,16 +187,13 @@ export function uiRawMembershipEditor(context) {
.append('li')
.attr('class', 'member-row member-row-normal form-field');
itemsEnter.each(function(d){
// highlight the relation in the map while hovering on the list item
d3_select(this)
.on('mouseover', function() {
utilHighlightEntities([d.relation.id], true, context);
})
.on('mouseout', function() {
utilHighlightEntities([d.relation.id], false, context);
});
});
// highlight the relation in the map while hovering on the list item
itemsEnter.on('mouseover', function(d) {
utilHighlightEntities([d.relation.id], true, context);
})
.on('mouseout', function(d) {
utilHighlightEntities([d.relation.id], false, context);
});
var labelEnter = itemsEnter
.append('label')