aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Timeline/Keyframe.reel/Keyframe.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/panels/Timeline/Keyframe.reel/Keyframe.js')
-rw-r--r--js/panels/Timeline/Keyframe.reel/Keyframe.js61
1 files changed, 61 insertions, 0 deletions
diff --git a/js/panels/Timeline/Keyframe.reel/Keyframe.js b/js/panels/Timeline/Keyframe.reel/Keyframe.js
new file mode 100644
index 00000000..859cdfb1
--- /dev/null
+++ b/js/panels/Timeline/Keyframe.reel/Keyframe.js
@@ -0,0 +1,61 @@
1/* <copyright>
2 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */
6
7var Montage = require("montage/core/core").Montage;
8var Component = require("montage/ui/component").Component;
9
10var Keyframe = exports.Keyframe = Montage.create(Component, {
11
12 hasTemplate:{
13 value: true
14 },
15
16 _position:{
17 value:0
18 },
19
20 position:{
21 serializable:true,
22 get:function(){
23 return this._position;
24 },
25 set:function(value){
26 this._position = value;
27 this.needsDraw = true;
28 }
29 },
30
31 prepareForDraw:{
32 value:function(){
33 this.element.addEventListener("click", this, false);
34 }
35 },
36
37 draw:{
38 value:function(){
39 this.element.style.left = (this.position - 3) + "px";
40 }
41 },
42
43 deselectKeyframe:{
44 value:function(){
45 this.element.classList.remove("keyframeSelected");
46 }
47 },
48
49 selectKeyframe:{
50 value:function(){
51 this.element.classList.add("keyframeSelected");
52 this.parentComponent.selectTween();
53 }
54 },
55
56 handleClick:{
57 value:function(ev){
58 this.selectKeyframe();
59 }
60 }
61});