diff --git a/src/editor/panels/TopPanel.js b/src/editor/panels/TopPanel.js index d0163493..34928a31 100644 --- a/src/editor/panels/TopPanel.js +++ b/src/editor/panels/TopPanel.js @@ -191,6 +191,7 @@ class TopPanel { this.hideTool("container_panel"); this.hideTool("use_panel"); this.hideTool("a_panel"); + this.hideTool("xy_panel"); if (elem) { const elname = elem.nodeName; diff --git a/src/svgcanvas/sanitize.js b/src/svgcanvas/sanitize.js index d3e65014..90f68bcd 100644 --- a/src/svgcanvas/sanitize.js +++ b/src/svgcanvas/sanitize.js @@ -55,7 +55,7 @@ const svgWhiteList_ = { stop: [ 'class', 'id', 'offset', 'requiredFeatures', 'stop-opacity', 'style', 'systemLanguage', 'stop-color', 'gradientUnits', 'gradientTransform' ], svg: [ 'class', 'clip-path', 'clip-rule', 'filter', 'id', 'height', 'mask', 'preserveAspectRatio', 'requiredFeatures', 'style', 'systemLanguage', 'version', 'viewBox', 'width', 'x', 'xmlns', 'xmlns:se', 'xmlns:xlink', 'xmlns:oi', 'oi:animations', 'y', 'stroke-linejoin', 'fill-rule', 'aria-label', 'stroke-width', 'fill-rule' ], switch: [ 'class', 'id', 'requiredFeatures', 'systemLanguage' ], - symbol: [ 'class', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'id', 'opacity', 'overflow', 'preserveAspectRatio', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'viewBox' ], + symbol: [ 'class', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'id', 'opacity', 'overflow', 'preserveAspectRatio', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'transform', 'viewBox', 'width', 'height' ], text: [ 'class', 'clip-path', 'clip-rule', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'font-family', 'font-size', 'font-style', 'font-weight', 'id', 'mask', 'opacity', 'requiredFeatures', 'stroke', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke-width', 'style', 'systemLanguage', 'text-anchor', 'transform', 'x', 'xml:space', 'y' ], textPath: [ 'class', 'id', 'method', 'requiredFeatures', 'spacing', 'startOffset', 'style', 'systemLanguage', 'transform', 'xlink:href' ], title: [], diff --git a/src/svgcanvas/selected-elem.js b/src/svgcanvas/selected-elem.js index 00758f8e..28bf680e 100644 --- a/src/svgcanvas/selected-elem.js +++ b/src/svgcanvas/selected-elem.js @@ -743,15 +743,17 @@ export const convertToGroup = function (elem) { // Not ideal, but works ts += ' translate(' + (pos.x || 0) + ',' + (pos.y || 0) + ')'; - const prev = $elem.prev(); + const prev = $elem.previousElementSibling; // Remove element - batchCmd.addSubCommand(new RemoveElementCommand($elem[0], $elem[0].nextSibling, $elem[0].parentNode)); + batchCmd.addSubCommand(new RemoveElementCommand($elem, $elem.nextElementSibling, $elem.parentNode)); $elem.remove(); // See if other elements reference this symbol const svgcontent = elementContext_.getSVGContent(); - const hasMore = svgcontent.querySelectorAll('use:data(symbol)').length; + // const hasMore = svgcontent.querySelectorAll('use:data(symbol)').length; + // @todo review this logic + const hasMore = svgcontent.querySelectorAll('use').length; const g = elementContext_.getDOMDocument().createElementNS(NS.SVG, 'g'); const childs = elem.childNodes;