diff --git a/src/fontra/views/editor/panel-designspace-navigation.js b/src/fontra/views/editor/panel-designspace-navigation.js index d47c9cd18..9447c762c 100644 --- a/src/fontra/views/editor/panel-designspace-navigation.js +++ b/src/fontra/views/editor/panel-designspace-navigation.js @@ -889,47 +889,36 @@ function suggestedSourceNameFromLocation(location) { function makeIconCellFactory(iconPaths, triggerOnDoubleClick = false) { return (item, colDesc) => { const value = item[colDesc.key]; + const clickSymbol = triggerOnDoubleClick ? "ondblclick" : "onclick"; const iconElement = html.createDomElement("inline-svg", { src: iconPaths[boolInt(value)], - }); - const clickSymbol = triggerOnDoubleClick ? "ondblclick" : "onclick"; - return html.div( - { - style: "width: 1.2em; height: 1.2em;", - ondblclick: (event) => { - event.stopImmediatePropagation(); - }, - [clickSymbol]: (event) => { - const newValue = !item[colDesc.key]; - item[colDesc.key] = newValue; - iconElement.src = iconPaths[boolInt(newValue)]; - event.stopImmediatePropagation(); - }, + style: "width: 1.2em; height: 1.2em;", + ondblclick: (event) => { + event.stopImmediatePropagation(); }, - [iconElement] - ); + [clickSymbol]: (event) => { + const newValue = !item[colDesc.key]; + item[colDesc.key] = newValue; + iconElement.src = iconPaths[boolInt(newValue)]; + event.stopImmediatePropagation(); + }, + }); + return iconElement; }; } function interpolationErrorCell(item, colDesc) { - const iconElement = html.createDomElement("inline-svg", { - src: "/tabler-icons/bug.svg", - }); return item[colDesc.key] - ? html.div( - { - style: "width: 1.2em; height: 1.2em; color: #F36;", - onclick: (event) => { - event.stopImmediatePropagation(); - dialog( - "The source has an interpolation incompatibility", - item[colDesc.key], - [{ title: "Okay" }] - ); - }, + ? html.createDomElement("inline-svg", { + src: "/tabler-icons/bug.svg", + style: "width: 1.2em; height: 1.2em; color: #F36;", + onclick: (event) => { + event.stopImmediatePropagation(); + dialog("The source has an interpolation incompatibility", item[colDesc.key], [ + { title: "Okay" }, + ]); }, - [iconElement] - ) + }) : ""; }