From 3c4994e3e9df74423634e97f39cefcd757538ea5 Mon Sep 17 00:00:00 2001 From: Tentone Date: Sat, 10 Feb 2018 14:04:58 +0000 Subject: [PATCH] Attach object to animation tab --- .../editor/ui/tab/animation/AnimationClipTrack.js | 8 ++++---- source/editor/ui/tab/animation/AnimationOptions.js | 2 +- source/editor/ui/tab/animation/AnimationTab.js | 13 +++++++------ 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/source/editor/ui/tab/animation/AnimationClipTrack.js b/source/editor/ui/tab/animation/AnimationClipTrack.js index bd4698567..181b5e199 100644 --- a/source/editor/ui/tab/animation/AnimationClipTrack.js +++ b/source/editor/ui/tab/animation/AnimationClipTrack.js @@ -10,10 +10,10 @@ function AnimationClipTrack(editor, animation) var height = 30 * tracks.length + 1; var self = this; - var button = new AnimationButton(this.editor.info, this.editor, animation); - button.position.set(0, this.editor.timebarHeight); - button.size.set(0, 30); - button.updateInterface(); + this.button = new AnimationButton(this.editor.info, this.editor, animation); + this.button.position.set(0, this.editor.timebarHeight); + this.button.size.set(0, 30); + this.button.updateInterface(); this.options = new AnimationOptions(this.editor.tracks, this.editor, animation); this.options.position.set(0, this.editor.timebarHeight); diff --git a/source/editor/ui/tab/animation/AnimationOptions.js b/source/editor/ui/tab/animation/AnimationOptions.js index a54604bda..526baf7a6 100644 --- a/source/editor/ui/tab/animation/AnimationOptions.js +++ b/source/editor/ui/tab/animation/AnimationOptions.js @@ -97,5 +97,5 @@ AnimationOptions.prototype.updateInterface = function() this.element.style.left = this.position.x + "px"; this.element.style.top = this.position.y + "px"; this.element.style.height = this.size.y + "px"; - this.element.style.width = "100%"; + this.element.style.width = this.size.x + "px"; }; \ No newline at end of file diff --git a/source/editor/ui/tab/animation/AnimationTab.js b/source/editor/ui/tab/animation/AnimationTab.js index f03d20d15..bb88bab50 100644 --- a/source/editor/ui/tab/animation/AnimationTab.js +++ b/source/editor/ui/tab/animation/AnimationTab.js @@ -181,6 +181,13 @@ function AnimationTab(parent, closeable, container, index) AnimationTab.prototype = Object.create(TabElement.prototype); +AnimationTab.prototype.attach = function() +{ + TabElement.prototype.attach.call(this); + + this.createTimeline(); +}; + AnimationTab.prototype.activate = function() { TabElement.prototype.activate.call(this); @@ -364,12 +371,6 @@ AnimationTab.prototype.updateInterface = function() this.bar.style.width = this.size.x + "px"; - /*for(var i = 0; i < this.animations.length; i++) - { - this.animations[i].options.size.set(this.timeline.scrollWidth, 30); - this.animations[i].options.updateInterface(); - }*/ - //Resizable division this.info.style.height = this.timeline.scrollHeight + "px"; this.info.style.width = this.tab.position + "px";