From a725643eba157b3c37d9acd13c6fdd48379bb0df Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Thu, 1 Mar 2012 10:38:47 -0800 Subject: Timeline: Merge. Set collapser heights. --- js/panels/Timeline/Layer.reel/Layer.html | 2 + js/panels/Timeline/Layer.reel/Layer.js | 12 +++--- .../Timeline/TimelinePanel.reel/TimelinePanel.js | 47 ++++++++++++++++++---- .../Timeline/TimelineTrack.reel/TimelineTrack.js | 2 +- 4 files changed, 48 insertions(+), 15 deletions(-) diff --git a/js/panels/Timeline/Layer.reel/Layer.html b/js/panels/Timeline/Layer.reel/Layer.html index 0bd448f7..cba963b6 100644 --- a/js/panels/Timeline/Layer.reel/Layer.html +++ b/js/panels/Timeline/Layer.reel/Layer.html @@ -226,6 +226,8 @@ } } } + + } diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index d50360e6..3e016c0c 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -418,7 +418,7 @@ var Layer = exports.Layer = Montage.create(Component, { defaultEventManager.dispatchEvent(newEvent); that.isMainCollapsed = that.mainCollapser.isCollapsed; } - this.mainCollapser.needsDraw = true; + //this.mainCollapser.needsDraw = true; this.positionCollapser.clicker = this.clickerPosition; this.positionCollapser.myContent = this.contentPosition; @@ -437,7 +437,7 @@ var Layer = exports.Layer = Montage.create(Component, { defaultEventManager.dispatchEvent(newEvent); that.isPositionCollapsed = that.positionCollapser.isCollapsed; } - this.positionCollapser.needsDraw = true; + //this.positionCollapser.needsDraw = true; this.transformCollapser.clicker = this.clickerTransform; this.transformCollapser.myContent = this.contentTransform; @@ -456,13 +456,13 @@ var Layer = exports.Layer = Montage.create(Component, { defaultEventManager.dispatchEvent(newEvent); that.isTransformCollapsed = that.transformCollapser.isCollapsed; } - this.transformCollapser.needsDraw = true; + //this.transformCollapser.needsDraw = true; this.styleCollapser.clicker = this.clickerStyle; this.styleCollapser.myContent = this.contentStyle; this.styleCollapser.element = this.element; this.styleCollapser.isCollapsed = this.isStyleCollapsed; - this.styleCollapser.contentHeight = 20; + this.styleCollapser.contentHeight = 0; this.styleCollapser.isAnimated = true; this.styleCollapser.labelClickEvent = function(boolBypass) { var newEvent = document.createEvent("CustomEvent"); @@ -474,7 +474,7 @@ var Layer = exports.Layer = Montage.create(Component, { defaultEventManager.dispatchEvent(newEvent); that.isStyleCollapsed = that.styleCollapser.isCollapsed; } - this.styleCollapser.needsDraw = true; + //this.styleCollapser.needsDraw = true; // Add event listeners to add and delete style buttons this.buttonAddStyle.identifier = "addStyle"; @@ -485,7 +485,7 @@ var Layer = exports.Layer = Montage.create(Component, { // Add mousedown listener to set isActive this.element.addEventListener("mousedown", this, false); - //this.element.addEventListener("click", this, false); + this.element.addEventListener("click", this, false); } }, diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index ec9555fe..59306705 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -47,9 +47,9 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { _cacheArrays : { value: function() { // Cache this.arrLayers and this.arrTracks. - console.log('cacheArrays ' + this._boolCacheArrays) + this.log('cacheArrays ' + this._boolCacheArrays) if (this._boolCacheArrays) { - console.log('caching arrays for ', this.application.ninja.currentDocument.name); + this.log('caching arrays for ', this.application.ninja.currentDocument.name); this.application.ninja.currentDocument.tlArrLayers = this.arrLayers; this.application.ninja.currentDocument.tlArrTracks = this.arrTracks; } @@ -264,7 +264,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { // Check to see if we have saved timeline information in the currentDocument. if (typeof(this.application.ninja.currentDocument.isTimelineInitialized) === "undefined") { // No, we have no information stored. Create it. - console.log('newfile ' + this.application.ninja.currentDocument.name) + this.log('newfile ' + this.application.ninja.currentDocument.name) this.application.ninja.currentDocument.isTimelineInitialized = true; this.application.ninja.currentDocument.tlArrLayers = []; this.application.ninja.currentDocument.tlArrTracks = []; @@ -281,7 +281,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this._openDoc=true; NJevent('newLayer',{key:this._hashKey,ele:this.application.ninja.currentDocument.documentRoot.children[myIndex]}) myIndex++; - k } + } } else{ NJevent('newLayer', this._hashKey); @@ -300,7 +300,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { } else { // we do have information stored. Use it. - console.log('oldfile ' + this.application.ninja.currentDocument.name) + this.log('oldfile ' + this.application.ninja.currentDocument.name) this._boolCacheArrays = false; this.arrLayers = []; this.arrTracks = []; @@ -469,7 +469,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { handleDeleteLayerClick:{ value:function (event) { - console.log('handleDeleteLayerClick called') + this.log('handleDeleteLayerClick called') if (this.arrLayers.length === 1) { // do not delete last layer return; @@ -795,7 +795,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { if(this.currentLayerSelected.elementsList[0]!==undefined){ if(this.currentTrackSelected.isTrackAnimated){ this.application.ninja.stage.clearDrawingCanvas(); - console.log("cannot add elements to a layer with animated element"); + this.log("cannot add elements to a layer with animated element"); return; }else{ this.hashElementMapToLayer.setItem(event.detail.uuid, event.detail,this.currentLayerSelected); @@ -1167,7 +1167,38 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { }); return command; } - } + }, /* === END: Controllers === */ + + /* === BEGIN: Logging routines === */ + _boolDebug: { + enumerable: false, + value: false // set to true to enable debugging to console; false for turning off all debugging. + }, + boolDebug: { + get: function() { + return this._boolDebug; + }, + set: function(boolDebugSwitch) { + this._boolDebug = boolDebugSwitch; + } + }, + log: { + value: function(strMessage) { + if (this.boolDebug) { + console.log(this.getLineNumber() + ": " + strMessage); + } + } + }, + getLineNumber: { + value: function() { + try { + throw new Error('bazinga') + }catch(e){ + return e.stack.split("at")[3].split(":")[2]; + } + } + } + /* === END: Logging routines === */ }); diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index f8f4f6b8..90b685dc 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -626,7 +626,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { this._styleCollapser = Collapser.create(); this._styleCollapser.clicker = this.labelStyles; this._styleCollapser.myContent = this.contentStyles; - this._styleCollapser.contentHeight = 20; + this._styleCollapser.contentHeight = 0; this._styleCollapser.isLabelClickable = false; this._styleCollapser.element = this.element; this._styleCollapser.isCollapsed = this.isStyleCollapsed; -- cgit v1.2.3