From c0f55416a3da7a1aa6f30907626e6fdb229384bc Mon Sep 17 00:00:00 2001 From: Timo Dittmann Date: Sat, 16 Jan 2021 13:34:25 +0100 Subject: [PATCH] Added object list to layers panel (#466) Co-authored-by: Timo Dittmann --- src/common/layer.js | 8 ++++ src/editor/images/svg_edit_icons.svg | 6 +++ src/editor/index.html | 10 +++++ src/editor/svgedit.css | 39 +++++++++++----- src/editor/svgedit.js | 67 +++++++++++++++++++++++++++- src/svgcanvas/draw.js | 55 +++++++++++++++++++++++ src/svgcanvas/sanitize.js | 24 +++++----- 7 files changed, 186 insertions(+), 23 deletions(-) diff --git a/src/common/layer.js b/src/common/layer.js index 9cc31d79..a34dc5ad 100644 --- a/src/common/layer.js +++ b/src/common/layer.js @@ -146,6 +146,14 @@ class Layer { } } + /** + * Returns all children of this layer. + * @returns {NodeListOf} The children of this layer. + */ + getChildren () { + return this.group_.childNodes; + } + /** * @returns {SVGTitleElement|null} */ diff --git a/src/editor/images/svg_edit_icons.svg b/src/editor/images/svg_edit_icons.svg index e7fac565..3eb60792 100644 --- a/src/editor/images/svg_edit_icons.svg +++ b/src/editor/images/svg_edit_icons.svg @@ -961,6 +961,12 @@ + + + + + + diff --git a/src/editor/index.html b/src/editor/index.html index 1d71bd16..ad1b99e6 100644 --- a/src/editor/index.html +++ b/src/editor/index.html @@ -65,6 +65,16 @@ Layer 1 + +

Objects

+ + + + + + +
Object 1
+ Move elements to: