diff options
author | Kruti Shah | 2012-07-09 11:30:37 -0700 |
---|---|---|
committer | Kruti Shah | 2012-07-09 11:30:37 -0700 |
commit | 35a31845720beb1296dc42a79fa068601dfc52cb (patch) | |
tree | 252ba58a3f2bb9600262c48571cc3dabaee36449 /js/panels/Timeline/Layer.reel | |
parent | b35edd96135bd8c2b500ffee08474bacd17c25ac (diff) | |
parent | 39aa69624e1e3b8598b0242ee6ec436862b67280 (diff) | |
download | ninja-35a31845720beb1296dc42a79fa068601dfc52cb.tar.gz |
Merge branch 'refs/heads/TimelineUberJD' into Timeline-local-kruti
Diffstat (limited to 'js/panels/Timeline/Layer.reel')
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.html | 34 | ||||
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.js | 120 | ||||
-rw-r--r-- | js/panels/Timeline/Layer.reel/css/Layer.css | 32 | ||||
-rw-r--r-- | js/panels/Timeline/Layer.reel/scss/Layer.scss | 32 |
4 files changed, 164 insertions, 54 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.html b/js/panels/Timeline/Layer.reel/Layer.html index 5ee50491..3c471952 100644 --- a/js/panels/Timeline/Layer.reel/Layer.html +++ b/js/panels/Timeline/Layer.reel/Layer.html | |||
@@ -1,9 +1,33 @@ | |||
1 | <!DOCTYPE html> | 1 | <!DOCTYPE html> |
2 | <!-- <copyright> | 2 | <!-- <copyright> |
3 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | 3 | Copyright (c) 2012, Motorola Mobility, Inc |
4 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | 4 | All Rights Reserved. |
5 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | 5 | BSD License. |
6 | </copyright> --> | 6 | |
7 | Redistribution and use in source and binary forms, with or without | ||
8 | modification, are permitted provided that the following conditions are met: | ||
9 | |||
10 | - Redistributions of source code must retain the above copyright notice, | ||
11 | this list of conditions and the following disclaimer. | ||
12 | - Redistributions in binary form must reproduce the above copyright | ||
13 | notice, this list of conditions and the following disclaimer in the | ||
14 | documentation and/or other materials provided with the distribution. | ||
15 | - Neither the name of Motorola Mobility nor the names of its contributors | ||
16 | may be used to endorse or promote products derived from this software | ||
17 | without specific prior written permission. | ||
18 | |||
19 | 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 | ||
21 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
22 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
23 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
24 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
25 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
26 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
27 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
28 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
29 | POSSIBILITY OF SUCH DAMAGE. | ||
30 | </copyright> --> | ||
7 | <html lang="en"> | 31 | <html lang="en"> |
8 | <head> | 32 | <head> |
9 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> | 33 | <meta http-equiv="content-type" content="text/html; charset=utf-8" /> |
@@ -307,4 +331,4 @@ | |||
307 | </div> | 331 | </div> |
308 | </div> | 332 | </div> |
309 | </body> | 333 | </body> |
310 | </html> \ No newline at end of file | 334 | </html> |
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 4dd9e88a..291e3416 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js | |||
@@ -1,8 +1,32 @@ | |||
1 | /* <copyright> | 1 | /* <copyright> |
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | 2 | Copyright (c) 2012, Motorola Mobility, Inc |
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | 3 | All Rights Reserved. |
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | 4 | BSD License. |
5 | </copyright> */ | 5 | |
6 | Redistribution and use in source and binary forms, with or without | ||
7 | modification, are permitted provided that the following conditions are met: | ||
8 | |||
9 | - Redistributions of source code must retain the above copyright notice, | ||
10 | this list of conditions and the following disclaimer. | ||
11 | - Redistributions in binary form must reproduce the above copyright | ||
12 | notice, this list of conditions and the following disclaimer in the | ||
13 | documentation and/or other materials provided with the distribution. | ||
14 | - Neither the name of Motorola Mobility nor the names of its contributors | ||
15 | may be used to endorse or promote products derived from this software | ||
16 | without specific prior written permission. | ||
17 | |||
18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
19 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
20 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
21 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
22 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
23 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
24 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
25 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
26 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
27 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
28 | POSSIBILITY OF SUCH DAMAGE. | ||
29 | </copyright> */ | ||
6 | 30 | ||
7 | var Montage = require("montage/core/core").Montage; | 31 | var Montage = require("montage/core/core").Montage; |
8 | var Component = require("montage/ui/component").Component; | 32 | var Component = require("montage/ui/component").Component; |
@@ -1046,25 +1070,28 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
1046 | 1070 | ||
1047 | handleLeftChange: { | 1071 | handleLeftChange: { |
1048 | value: function(event) { | 1072 | value: function(event) { |
1073 | var prevPosition; | ||
1074 | if(this.application.ninja.timeline.selectedStyle==="left" ||this.application.ninja.timeline.selectedStyle==="master" ){ | ||
1075 | if(!event.wasSetByCode) { | ||
1076 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; | ||
1077 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Change", "timeline", prevPosition); | ||
1078 | this.savedPosition = null; | ||
1079 | } | ||
1049 | 1080 | ||
1050 | var prevPosition; | ||
1051 | if(!event.wasSetByCode) { | ||
1052 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; | ||
1053 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Change", "timeline", prevPosition); | ||
1054 | this.savedPosition = null; | ||
1055 | } | 1081 | } |
1056 | } | 1082 | } |
1057 | }, | 1083 | }, |
1058 | 1084 | ||
1059 | handleTopChange: { | 1085 | handleTopChange: { |
1060 | value: function(event) { | 1086 | value: function(event) { |
1061 | var prevPosition; | 1087 | var prevPosition; |
1062 | 1088 | if(this.application.ninja.timeline.selectedStyle==="top" ||this.application.ninja.timeline.selectedStyle==="master" ){ | |
1063 | if(!event.wasSetByCode) { | 1089 | if(!event.wasSetByCode) { |
1064 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; | 1090 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; |
1065 | 1091 | ||
1066 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Change", "timeline", prevPosition); | 1092 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Change", "timeline", prevPosition); |
1067 | this.savedPosition = null; | 1093 | this.savedPosition = null; |
1094 | } | ||
1068 | } | 1095 | } |
1069 | } | 1096 | } |
1070 | }, | 1097 | }, |
@@ -1072,12 +1099,13 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
1072 | handleWidthChange:{ | 1099 | handleWidthChange:{ |
1073 | value: function(event) { | 1100 | value: function(event) { |
1074 | var prevPosition; | 1101 | var prevPosition; |
1102 | if(this.application.ninja.timeline.selectedStyle==="width" ||this.application.ninja.timeline.selectedStyle==="master" ){ | ||
1103 | if(!event.wasSetByCode) { | ||
1104 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; | ||
1075 | 1105 | ||
1076 | if(!event.wasSetByCode) { | 1106 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Change", "timeline", prevPosition); |
1077 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; | 1107 | this.savedPosition = null; |
1078 | 1108 | } | |
1079 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Change", "timeline", prevPosition); | ||
1080 | this.savedPosition = null; | ||
1081 | } | 1109 | } |
1082 | } | 1110 | } |
1083 | }, | 1111 | }, |
@@ -1085,12 +1113,13 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
1085 | handleHeightChange:{ | 1113 | handleHeightChange:{ |
1086 | value: function(event) { | 1114 | value: function(event) { |
1087 | var prevPosition; | 1115 | var prevPosition; |
1116 | if(this.application.ninja.timeline.selectedStyle==="height" ||this.application.ninja.timeline.selectedStyle==="master" ){ | ||
1117 | if(!event.wasSetByCode) { | ||
1118 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; | ||
1088 | 1119 | ||
1089 | if(!event.wasSetByCode) { | 1120 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Change", "timeline", prevPosition); |
1090 | if(this.savedPosition) prevPosition = [this.savedPosition + "px"]; | 1121 | this.savedPosition = null; |
1091 | 1122 | } | |
1092 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Change", "timeline", prevPosition); | ||
1093 | this.savedPosition = null; | ||
1094 | } | 1123 | } |
1095 | } | 1124 | } |
1096 | }, | 1125 | }, |
@@ -1098,9 +1127,11 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
1098 | handleLeftChanging: { | 1127 | handleLeftChanging: { |
1099 | value: function(event) { | 1128 | value: function(event) { |
1100 | 1129 | ||
1101 | if(!event.wasSetByCode) { | 1130 | if(this.application.ninja.timeline.selectedStyle==="left" ||this.application.ninja.timeline.selectedStyle==="master" ){ |
1102 | if(!this.savedPosition) this.savedPosition = this.leftPosition; | 1131 | if(!event.wasSetByCode) { |
1103 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Changing", "timeline"); | 1132 | if(!this.savedPosition) this.savedPosition = this.leftPosition; |
1133 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "left", [this.leftControl.value + "px"] , "Changing", "timeline"); | ||
1134 | } | ||
1104 | } | 1135 | } |
1105 | 1136 | ||
1106 | } | 1137 | } |
@@ -1108,31 +1139,37 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
1108 | 1139 | ||
1109 | handleTopChanging: { | 1140 | handleTopChanging: { |
1110 | value: function(event) { | 1141 | value: function(event) { |
1111 | 1142 | if(this.application.ninja.timeline.selectedStyle==="top" ||this.application.ninja.timeline.selectedStyle==="master" ){ | |
1112 | if(!event.wasSetByCode) { | 1143 | if(!event.wasSetByCode) { |
1113 | if(!this.savedPosition) this.savedPosition = this.topPosition; | 1144 | if(!this.savedPosition) this.savedPosition = this.topPosition; |
1114 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Changing", "timeline"); | 1145 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "top", [this.topControl.value + "px"] , "Changing", "timeline"); |
1146 | } | ||
1115 | } | 1147 | } |
1148 | |||
1116 | } | 1149 | } |