Flash the "change feature type" button in the inspector whenever the preset changes (close #6764)

This commit is contained in:
Quincy Morgan
2019-10-03 18:50:33 +02:00
parent b69aa45010
commit 3b671bf4e4

View File

@@ -262,6 +262,16 @@ export function uiEntityEditor(context) {
// Don't replace a weak preset with a fallback preset (e.g. "Point")
if (!(weakPreset && match.isFallback())) {
entityEditor.preset(match);
if (match.id !== activePreset.id) {
// flash the button to indicate the preset changed
selection
.selectAll('button.preset-reset .label')
.style('background-color', '#fff')
.transition()
.duration(500)
.style('background-color', null);
}
}
entityEditor.modified(_base !== graph);
entityEditor(selection);