mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-12 16:52:50 +00:00
Fix issue where items could not be deselected from the selection list in some browsers (close #8151)
This commit is contained in:
@@ -1010,6 +1010,22 @@ a.hide-toggle {
|
||||
.section-selected-features .feature-list-item:last-child {
|
||||
border: none;
|
||||
}
|
||||
.ideditor[dir='ltr'] .section-selected-features .feature-list-item > button:not(:first-child) {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
.ideditor[dir='rtl'] .section-selected-features .feature-list-item > button:not(:last-child) {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.ideditor[dir='ltr'] .section-selected-features .feature-list-item > button:not(:last-child) {
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
||||
.ideditor[dir='rtl'] .section-selected-features .feature-list-item > button:not(:last-child) {
|
||||
border-top-left-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
|
||||
/* Preset List and Icons
|
||||
------------------------------------------------------- */
|
||||
|
||||
@@ -39,8 +39,6 @@ export function uiSectionSelectionList(context) {
|
||||
}
|
||||
|
||||
function deselectEntity(d3_event, entity) {
|
||||
d3_event.stopPropagation();
|
||||
|
||||
var selectedIDs = _selectedIDs.slice();
|
||||
var index = selectedIDs.indexOf(entity.id);
|
||||
if (index > -1) {
|
||||
@@ -55,7 +53,7 @@ export function uiSectionSelectionList(context) {
|
||||
.data([0]);
|
||||
|
||||
list = list.enter()
|
||||
.append('div')
|
||||
.append('ul')
|
||||
.attr('class', 'feature-list')
|
||||
.merge(list);
|
||||
|
||||
@@ -71,30 +69,22 @@ export function uiSectionSelectionList(context) {
|
||||
|
||||
// Enter
|
||||
var enter = items.enter()
|
||||
.append('button')
|
||||
.append('li')
|
||||
.attr('class', 'feature-list-item')
|
||||
.on('click', selectEntity);
|
||||
|
||||
enter
|
||||
.each(function(d) {
|
||||
d3_select(this).on('mouseover', function() {
|
||||
utilHighlightEntities([d.id], true, context);
|
||||
});
|
||||
d3_select(this).on('mouseout', function() {
|
||||
utilHighlightEntities([d.id], false, context);
|
||||
});
|
||||
d3_select(this)
|
||||
.on('mouseover', function() {
|
||||
utilHighlightEntities([d.id], true, context);
|
||||
})
|
||||
.on('mouseout', function() {
|
||||
utilHighlightEntities([d.id], false, context);
|
||||
});
|
||||
});
|
||||
|
||||
var label = enter
|
||||
.append('div')
|
||||
.attr('class', 'label');
|
||||
|
||||
enter
|
||||
.append('button')
|
||||
.attr('class', 'close')
|
||||
.attr('title', t('icons.deselect'))
|
||||
.on('click', deselectEntity)
|
||||
.call(svgIcon('#iD-icon-close'));
|
||||
.attr('class', 'label')
|
||||
.on('click', selectEntity);
|
||||
|
||||
label
|
||||
.append('span')
|
||||
@@ -109,6 +99,13 @@ export function uiSectionSelectionList(context) {
|
||||
.append('span')
|
||||
.attr('class', 'entity-name');
|
||||
|
||||
enter
|
||||
.append('button')
|
||||
.attr('class', 'close')
|
||||
.attr('title', t('icons.deselect'))
|
||||
.on('click', deselectEntity)
|
||||
.call(svgIcon('#iD-icon-close'));
|
||||
|
||||
// Update
|
||||
items = items.merge(enter);
|
||||
|
||||
|
||||
@@ -155,12 +155,12 @@ export function uiSidebar(context) {
|
||||
.attr('class', 'inspector-hidden inspector-wrap');
|
||||
|
||||
var hoverModeSelect = function(targets) {
|
||||
context.container().selectAll('.feature-list-item').classed('hover', false);
|
||||
context.container().selectAll('.feature-list-item button').classed('hover', false);
|
||||
|
||||
if (context.selectedIDs().length > 1 &&
|
||||
targets && targets.length) {
|
||||
|
||||
var elements = context.container().selectAll('.feature-list-item')
|
||||
var elements = context.container().selectAll('.feature-list-item button')
|
||||
.filter(function (node) {
|
||||
return targets.indexOf(node) !== -1;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user