-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
calling canvas.createLayer() programatically doesn't update layers panel #104
Comments
Ok, I will have to try look at the code and think more about this (maybe tonight or tomorrow). I have a gut preference for suggestion #1 with the caveat that documents re-loaded back in would get the class="layer" added like you suggest |
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 24, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 24, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 24, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 24, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 24, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 24, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 24, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 24, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 24, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 24, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 24, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 24, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 25, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 25, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 25, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 25, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 25, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 27, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 27, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 27, 2021
AgriyaDev5
added a commit
to OptimistikSAS/svgedit
that referenced
this issue
May 27, 2021
jfhenon
added a commit
that referenced
this issue
May 27, 2021
#104 Jquery convert to pure javascript
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm happy to fix this, just looking to narrow down possible options....
Problem
For our application; on startup of svgedit, we rename "Layer 1" and create a second layer. The layers panel is not repopulated and still shows one layer, "Layer 1" even though the document has been updated correctly.
Analysis
createLayer does issue
call('changed', [new_layer])
, but the layers panel is looking for change tosvg#svgcontent
, not the<g>
element of the new layer.Here's the relevant code in svg-editor.js
Possible fixes
class="layer"
to the layer group element to identify layers. Then elementChanged can easily identify a layer change. This is clean but not backwards compatible for old documents (unless we add code to update them on load).svg
withid === 'svgcontent'
to identify layer changes.svgedit.draw.Drawing.prototype.identifyLayers
could issue a more direct broadcast message to notify the layers panel that the layers have changed. I don't know the repercussions of this.From what I currently know, I'd recommend option 2. If I was designing from scratch, I'd pick 1.
The text was updated successfully, but these errors were encountered: