From 3669eea4bde3518ce080048e9f53d2dd111fd8be Mon Sep 17 00:00:00 2001 From: Jon Reid Date: Wed, 21 Mar 2012 11:37:48 -0700 Subject: Timeline: Bug fix: style collapsers not staying in synch. Also, removed console.log calls in hintable component. --- js/components/editable.reel/editable.js | 8 ++++---- js/components/hintable.reel/hintable.js | 12 ++++++------ js/panels/Timeline/Layer.reel/Layer.js | 3 +++ js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js | 16 +++++++++++----- js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 4 ++-- 5 files changed, 26 insertions(+), 17 deletions(-) diff --git a/js/components/editable.reel/editable.js b/js/components/editable.reel/editable.js index 9c8946c4..7a31e7fd 100644 --- a/js/components/editable.reel/editable.js +++ b/js/components/editable.reel/editable.js @@ -120,7 +120,7 @@ exports.Editable = Montage.create(Component, { } if(this.stopOnBlur) { - console.log('adding mousedown event listener'); + //console.log('adding mousedown event listener'); ///// Simulate blur on editable node by listening to the doc document.addEventListener('mouseup', this, false); } @@ -189,7 +189,7 @@ exports.Editable = Montage.create(Component, { handleKeydown : { value : function(e) { var k = e.keyCode; - console.log('keyCode: ' + k); + //console.log('keyCode: ' + k); } }, ///// Text input has changed values @@ -204,7 +204,7 @@ exports.Editable = Montage.create(Component, { }, handleMouseup : { value : function(e) { - console.log('handle mouse down'); + //console.log('handle mouse down'); ///// Listen for simulated blur event if(this.stopOnBlur && e._event.target !== this._element) { this.blur(); @@ -213,7 +213,7 @@ exports.Editable = Montage.create(Component, { }, handleEvent : { value : function(e) { - console.log("event type : " + e._event.type); + //console.log("event type : " + e._event.type); ///// If configured, start on specified event if(e._event.type === this.startOnEvent) { this.start(); diff --git a/js/components/hintable.reel/hintable.js b/js/components/hintable.reel/hintable.js index 5ed46b3c..cbfe2d9b 100644 --- a/js/components/hintable.reel/hintable.js +++ b/js/components/hintable.reel/hintable.js @@ -90,10 +90,10 @@ exports.Hintable = Montage.create(Editable, { hintNext : { value : function(e) { if(e) { e.preventDefault(); } - console.log('next1'); + //console.log('next1'); if(this._matchIndex < this.matches.length - 1) { - console.log('next'); + //console.log('next'); ++this._matchIndex; this.hint = this._getHintDifference(); } @@ -102,9 +102,9 @@ exports.Hintable = Montage.create(Editable, { hintPrev : { value : function(e) { if(e) { e.preventDefault(); } - console.log('prev1'); + //console.log('prev1'); if(this._matchIndex !== 0) { - console.log('prev'); + //console.log('prev'); --this._matchIndex; this.hint = this._getHintDifference(); } @@ -135,7 +135,7 @@ exports.Hintable = Montage.create(Editable, { /// revert to old value this.value = (this._preEditValue); this._sendEvent('revert'); - console.log('reverting'); + //console.log('reverting'); } } @@ -180,7 +180,7 @@ exports.Hintable = Montage.create(Editable, { var val = this.value, matches, hint; - console.log('val = "' + val + '"'); + //console.log('val = "' + val + '"'); //// Handle auto-suggest if configured if(this.hints instanceof Array) { diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 9334a0b4..fcdbcd22 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js @@ -571,6 +571,8 @@ var Layer = exports.Layer = Montage.create(Component, { newEvent = document.createEvent("CustomEvent"); this.isStyleCollapsed = false; + this.layerData.isStyleCollapsed = false; + this.triggerOutgoingBinding(); newEvent.initCustomEvent("layerEvent", false, true); newEvent.layerEventLocale = "styles"; @@ -603,6 +605,7 @@ var Layer = exports.Layer = Montage.create(Component, { newEvent.styleSelection = mySelection; defaultEventManager.dispatchEvent(newEvent); + } }, deleteStyle : { diff --git a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js index 03d06d98..0ba49c44 100644 --- a/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js +++ b/js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js @@ -915,11 +915,7 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { this.arrLayers[i].layerData.isSelected = false; } - if (this.arrLayers[i].layerData.triggerBinding === true) { - this.arrLayers[i].layerData.triggerBinding = false; - } else { - this.arrLayers[i].layerData.triggerBinding = true; - } + this.triggerLayerBinding(i); } this.layerRepetition.selectedIndexes = [layerIndex]; @@ -1077,6 +1073,16 @@ var TimelinePanel = exports.TimelinePanel = Montage.create(Component, { } } }, + // Trigger the layer/track data binding + triggerLayerBinding : { + value: function(intIndex) { + if (this.arrLayers[intIndex].layerData.triggerBinding === true) { + this.arrLayers[intIndex].layerData.triggerBinding = false; + } else { + this.arrLayers[intIndex].layerData.triggerBinding = true; + } + } + }, /* === END: Controllers === */ /* === BEGIN: Logging routines === */ diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index e9a2115a..011d991e 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js @@ -672,8 +672,8 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { } else if (layerEvent.layerEventType === "newStyle") { this.arrStyleTracks.push("1"); if (this._styleCollapser.isCollapsed === true) { - this._styleCollapser.bypassAnimation = layerEvent.bypassAnimation; - this._styleCollapser.handleCollapserLabelClick(); + //this._styleCollapser.bypassAnimation = layerEvent.bypassAnimation; + //this._styleCollapser.handleCollapserLabelClick(); } } else if (layerEvent.layerEventType === "deleteStyle") { this.arrStyleTracks.pop(); -- cgit v1.2.3