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/Layer.js | |
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/Layer.js')
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.js | 120 |
1 files changed, 79 insertions, 41 deletions
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 | } |
1117 | }, | 1150 | }, |
1118 | 1151 | ||
1119 | handleWidthChanging:{ | 1152 | handleWidthChanging:{ |
1120 | value: function(event) { | 1153 | value: function(event) { |
1121 | 1154 | if(this.application.ninja.timeline.selectedStyle==="width" ||this.application.ninja.timeline.selectedStyle==="master" ){ | |
1122 | if(!event.wasSetByCode) { | 1155 | if(!event.wasSetByCode) { |
1123 | if(!this.savedPosition) this.savedPosition = this.dtextScaleX; | 1156 | if(!this.savedPosition) this.savedPosition = this.dtextScaleX; |
1124 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Changing", "timeline"); | 1157 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "width", [this.dtextScaleX + "px"] , "Changing", "timeline"); |
1158 | } | ||
1125 | } | 1159 | } |
1160 | |||
1126 | } | 1161 | } |
1127 | }, | 1162 | }, |
1128 | 1163 | ||
1129 | handleHeightChanging:{ | 1164 | handleHeightChanging:{ |
1130 | value: function(event) { | 1165 | value: function(event) { |
1131 | 1166 | if(this.application.ninja.timeline.selectedStyle==="height" ||this.application.ninja.timeline.selectedStyle==="master" ){ | |
1132 | if(!event.wasSetByCode) { | 1167 | if(!event.wasSetByCode) { |
1133 | if(!this.savedPosition) this.savedPosition = this.dtextScaleY; | 1168 | if(!this.savedPosition) this.savedPosition = this.dtextScaleY; |
1134 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Changing", "timeline"); | 1169 | this.application.ninja.elementMediator.setProperty([this.layerData.stageElement], "height", [this.dtextScaleY + "px"] , "Changing", "timeline"); |
1170 | } | ||
1135 | } | 1171 | } |
1172 | |||
1136 | } | 1173 | } |
1137 | }, | 1174 | }, |
1138 | 1175 | ||
@@ -1367,6 +1404,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
1367 | } | 1404 | } |
1368 | } | 1405 | } |
1369 | } | 1406 | } |
1370 | /* End: Logging routines */ | 1407 | |
1408 | /* End: Event handlers */ | ||
1371 | 1409 | ||
1372 | }); | 1410 | }); |