diff options
Diffstat (limited to 'js/panels/Timeline/Layer.reel/Layer.js')
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.js | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 9edd2b35..233e811f 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js | |||
@@ -51,6 +51,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
51 | value: false | 51 | value: false |
52 | }, | 52 | }, |
53 | styleRepetition : { | 53 | styleRepetition : { |
54 | serializable: true, | ||
54 | get: function() { | 55 | get: function() { |
55 | return this._styleRepetition; | 56 | return this._styleRepetition; |
56 | }, | 57 | }, |
@@ -61,8 +62,17 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
61 | _styleCounter : { | 62 | _styleCounter : { |
62 | value: 0 | 63 | value: 0 |
63 | }, | 64 | }, |
65 | styleCounter:{ | ||
66 | serializable:true, | ||
67 | get:function () { | ||
68 | return this._styleCounter; | ||
69 | }, | ||
70 | set:function (newVal) { | ||
71 | this._styleCounter = newVal; | ||
72 | } | ||
73 | }, | ||
64 | 74 | ||
65 | /* Layer models: the name, ID, and selected and animation booleans for the layer */ | 75 | /* Layer models: the name, ID, and selected and animation booleans for the layer */ |
66 | _layerName:{ | 76 | _layerName:{ |
67 | value: "Default Layer Name" | 77 | value: "Default Layer Name" |
68 | }, | 78 | }, |
@@ -635,8 +645,8 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
635 | newEvent.layerEventLocale = "styles"; | 645 | newEvent.layerEventLocale = "styles"; |
636 | newEvent.layerEventType = "newStyle"; | 646 | newEvent.layerEventType = "newStyle"; |
637 | newEvent.layerID = this.layerID; | 647 | newEvent.layerID = this.layerID; |
638 | newEvent.styleIndex = this._styleCounter; | 648 | newEvent.styleIndex = this.styleCounter; |
639 | newEvent.styleID = this.layerID + "@" + this._styleCounter; | 649 | newEvent.styleID = this.layerID + "@" + this.styleCounter; |
640 | 650 | ||
641 | newStyle.styleID = newEvent.styleID; | 651 | newStyle.styleID = newEvent.styleID; |
642 | newStyle.whichView = "hintable"; | 652 | newStyle.whichView = "hintable"; |
@@ -644,26 +654,12 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
644 | newStyle.editorValue = ""; | 654 | newStyle.editorValue = ""; |
645 | newStyle.ruleTweener = false; | 655 | newStyle.ruleTweener = false; |
646 | newStyle.isSelected = false; | 656 | newStyle.isSelected = false; |
657 | this.arrLayerStyles.push(newStyle); | ||
647 | 658 | ||
648 | if (!!this.styleRepetition.selectedIndexes) { | ||
649 | mySelection = this.styleRepetition.selectedIndexes[0]; | ||
650 | this.arrLayerStyles.splice(mySelection, 0, newStyle); | ||
651 | //this.styleRepetition.selectedIndexes = [mySelection]; | ||
652 | this.selectStyle(mySelection); | ||
653 | } else { | ||
654 | newLength = this.arrLayerStyles.length; | ||
655 | this.arrLayerStyles.push(newStyle); | ||
656 | mySelection = this.arrLayerStyles.length; | ||
657 | // this.styleRepetition.selectedIndexes = [mySelection-1]; | ||
658 | this.selectStyle(mySelection-1); | ||
659 | } | ||
660 | |||
661 | // Set up the event info and dispatch the event | 659 | // Set up the event info and dispatch the event |
662 | this._styleCounter += 1; | 660 | this.styleCounter += 1; |
663 | newEvent.styleSelection = mySelection; | 661 | newEvent.styleSelection = mySelection; |
664 | defaultEventManager.dispatchEvent(newEvent); | 662 | defaultEventManager.dispatchEvent(newEvent); |
665 | |||
666 | |||
667 | } | 663 | } |
668 | }, | 664 | }, |
669 | deleteStyle : { | 665 | deleteStyle : { |