diff options
Diffstat (limited to 'js/panels/Timeline/TimelineTrack.reel')
-rw-r--r-- | js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | 1060 |
1 files changed, 471 insertions, 589 deletions
diff --git a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js index fc9f9cf3..2581df0f 100644 --- a/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js +++ b/js/panels/Timeline/TimelineTrack.reel/TimelineTrack.js | |||
@@ -1,25 +1,24 @@ | |||
1 | /* <copyright> | 1 | /* <copyright> |
2 | Copyright (c) 2012, Motorola Mobility LLC. | 2 | Copyright (c) 2012, Motorola Mobility, Inc |
3 | All Rights Reserved. | 3 | All Rights Reserved. |
4 | BSD License. | ||
4 | 5 | ||
5 | Redistribution and use in source and binary forms, with or without | 6 | Redistribution and use in source and binary forms, with or without |
6 | modification, are permitted provided that the following conditions are met: | 7 | modification, are permitted provided that the following conditions are met: |
7 | 8 | ||
8 | * Redistributions of source code must retain the above copyright notice, | 9 | - Redistributions of source code must retain the above copyright notice, |
9 | this list of conditions and the following disclaimer. | 10 | this list of conditions and the following disclaimer. |
10 | 11 | - Redistributions in binary form must reproduce the above copyright | |
11 | * Redistributions in binary form must reproduce the above copyright notice, | 12 | notice, this list of conditions and the following disclaimer in the |
12 | this list of conditions and the following disclaimer in the documentation | 13 | documentation and/or other materials provided with the distribution. |
13 | and/or other materials provided with the distribution. | 14 | - Neither the name of Motorola Mobility nor the names of its contributors |
14 | 15 | may be used to endorse or promote products derived from this software | |
15 | * Neither the name of Motorola Mobility LLC nor the names of its | 16 | without specific prior written permission. |
16 | contributors may be used to endorse or promote products derived from this | ||
17 | software without specific prior written permission. | ||
18 | 17 | ||
19 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
20 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | 20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | 21 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE |
23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
@@ -36,27 +35,26 @@ var defaultEventManager = require("montage/core/event/event-manager").defaultEve | |||
36 | 35 | ||
37 | var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | 36 | var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { |
38 | 37 | ||
38 | // ==== Begin Models | ||
39 | _trackID:{ | 39 | _trackID:{ |
40 | value:null | 40 | value:null |
41 | }, | 41 | }, |
42 | |||
43 | trackID:{ | 42 | trackID:{ |
44 | serializable:true, | 43 | serializable:true, |
45 | get:function () { | 44 | get:function () { |
46 | return this._trackID; | 45 | return this._trackID; |
47 | }, | 46 | }, |
48 | set:function (value) { | 47 | set:function (value) { |
49 | if (value !== this._trackID) { | 48 | if (value !== this._trackID) { |
50 | this._trackID = value; | 49 | this._trackID = value; |
51 | this.trackData.layerID = value; | 50 | this.trackData.layerID = value; |
52 | } | 51 | } |
53 | } | 52 | } |
54 | }, | 53 | }, |
55 | 54 | ||
56 | _tween:{ | 55 | _tween:{ |
57 | value:[] | 56 | value:[] |
58 | }, | 57 | }, |
59 | |||
60 | tween:{ | 58 | tween:{ |
61 | serializable:true, | 59 | serializable:true, |
62 | get:function () { | 60 | get:function () { |
@@ -70,48 +68,61 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
70 | positionPropertyTrack:{ | 68 | positionPropertyTrack:{ |
71 | value:null | 69 | value:null |
72 | }, | 70 | }, |
73 | 71 | ||
74 | _isFirstDraw: { | 72 | _isFirstDraw: { |
75 | value: true | 73 | value: true |
76 | }, | 74 | }, |
77 | 75 | ||
78 | _isVisible:{ | 76 | _isVisible:{ |
79 | value: true | 77 | value: true |
80 | }, | 78 | }, |
81 | |||
82 | isVisible:{ | 79 | isVisible:{ |
83 | get:function(){ | 80 | get:function(){ |
84 | return this._isVisible; | 81 | return this._isVisible; |
85 | }, | 82 | }, |
86 | set:function(value){ | 83 | set:function(value){ |
87 | if (this._isVisible !== value) { | 84 | if (this._isVisible !== value) { |
88 | this._isVisible = value; | 85 | this._isVisible = value; |
89 | if (this.element !== null) { | 86 | if (this.element !== null) { |
90 | if (value === true) { | 87 | if (value === true) { |
91 | this.element.classList.remove("layer-hidden"); | 88 | this.element.classList.remove("layer-hidden"); |
92 | } else { | 89 | } else { |
93 | this.element.classList.add("layer-hidden"); | 90 | this.element.classList.add("layer-hidden"); |
94 | } | 91 | } |
95 | } | 92 | } |
96 | } | 93 | } |
97 | this.trackData.isVisible = value; | 94 | this.trackData.isVisible = value; |
98 | } | 95 | } |
99 | }, | 96 | }, |
100 | 97 | ||
98 | _bindingPoint : { | ||
99 | value : {} | ||
100 | }, | ||
101 | bindingPoint: { | ||
102 | get: function() { | ||
103 | return this._bindingPoint; | ||
104 | }, | ||
105 | set: function(newVal) { | ||
106 | if (newVal !== this._bindingPoint) { | ||
107 | this._bindingPoint = newVal; | ||
108 | this.setData(); | ||
109 | } | ||
110 | } | ||
111 | }, | ||
112 | |||
101 | _stageElement: { | 113 | _stageElement: { |
102 | value: null | 114 | value: null |
103 | }, | 115 | }, |
104 | stageElement: { | 116 | stageElement: { |
105 | get: function() { | 117 | get: function() { |
106 | return this._stageElement; | 118 | return this._stageElement; |
107 | }, | 119 | }, |
108 | set: function(newVal) { | 120 | set: function(newVal) { |
109 | this._stageElement = newVal; | 121 | this._stageElement = newVal; |
110 | this.trackData.stageElement = newVal; | 122 | this.trackData.stageElement = newVal; |
111 | } | 123 | } |
112 | }, | 124 | }, |
113 | 125 | ||
114 | // Are the various collapsers collapsed or not | ||
115 | _isMainCollapsed:{ | 126 | _isMainCollapsed:{ |
116 | value: true | 127 | value: true |
117 | }, | 128 | }, |
@@ -124,18 +135,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
124 | this.trackData.isMainCollapsed = newVal; | 135 | this.trackData.isMainCollapsed = newVal; |
125 | } | 136 | } |
126 | }, | 137 | }, |
127 | _isTransformCollapsed:{ | 138 | |
128 | value:true | ||
129 | }, | ||
130 | isTransformCollapsed:{ | ||
131 | get:function () { | ||
132 | return this._isTransformCollapsed; | ||
133 | }, | ||
134 | set:function (newVal) { | ||
135 | this._isTransformCollapsed = newVal; | ||
136 | this.trackData.isTransformCollapsed = newVal; | ||
137 | } | ||
138 | }, | ||
139 | _isPositionCollapsed:{ | 139 | _isPositionCollapsed:{ |
140 | value:true | 140 | value:true |
141 | }, | 141 | }, |
@@ -148,6 +148,7 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
148 | this.trackData.isPositionCollapsed = newVal; | 148 | this.trackData.isPositionCollapsed = newVal; |
149 | } | 149 | } |
150 | }, | 150 | }, |
151 | |||
151 | _isStyleCollapsed:{ | 152 | _isStyleCollapsed:{ |
152 | value:true | 153 | value:true |
153 | }, | 154 | }, |
@@ -160,97 +161,82 @@ var TimelineTrack = exports.TimelineTrack = Montage.create(Component, { | |||
160 | this.trackData.isStyleCollapsed = newVal; | 161 | this.trackData.isStyleCollapsed = newVal; |
161 | } | 162 | } |
162 | }, | 163 | }, |
164 | |||
163 | _bypassAnimation : { | 165 | _bypassAnimation : { |
164 | value: false | 166 | value: false |
165 | }, | 167 | }, |
166 | bypassAnimation : { |