Method to remove codec event listeners

Switching modes no longer resets animation timeline selection
This commit is contained in:
JannisX11 2021-01-03 22:51:49 +01:00
parent ab916f50ab
commit c11638c738
2 changed files with 10 additions and 2 deletions

View File

@ -1215,8 +1215,11 @@ const Animator = {
outlines.children.empty()
Canvas.updateAllPositions()
}
if (Animator.animations.length) {
Animator.animations[0].select()
if (Animation.all.length && !Animation.all.includes(Animation.selected)) {
Animation.all[0].select();
}
if (Group.selected) {
Group.selected.select();
}
Animator.preview()
},

View File

@ -114,6 +114,11 @@ class Codec {
}
this.events[event_name].safePush(cb)
}
removeListener(event_name, cb) {
if (this.events[event_name]) {
this.events[event_name].remove(cb);
}
}
//Delete
delete() {
delete Codecs[this.id];