diff options
author | Jonathan Duran | 2012-04-12 09:11:05 -0700 |
---|---|---|
committer | Jonathan Duran | 2012-04-12 09:11:05 -0700 |
commit | 931c11bff128471dd51e0bab3ce5d38e7c6fc68c (patch) | |
tree | 65d47637032c83dd6caa4fd910b8cf54199f1812 /js/controllers/styles-controller.js | |
parent | a8f9087b7daf7d48070bbeb4fff1c25ade413909 (diff) | |
parent | 9d1c919a4865ab1a2b0b0b9fc893a54b145c82c0 (diff) | |
download | ninja-931c11bff128471dd51e0bab3ce5d38e7c6fc68c.tar.gz |
Merge branch 'refs/heads/NINJAmaster' into TimelineUber
Diffstat (limited to 'js/controllers/styles-controller.js')
-rwxr-xr-x | js/controllers/styles-controller.js | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/js/controllers/styles-controller.js b/js/controllers/styles-controller.js index 5d5f27ba..ec4314f9 100755 --- a/js/controllers/styles-controller.js +++ b/js/controllers/styles-controller.js | |||
@@ -1130,7 +1130,7 @@ var stylesController = exports.StylesController = Montage.create(Component, { | |||
1130 | 1130 | ||
1131 | getMatrixFromElement : { | 1131 | getMatrixFromElement : { |
1132 | value: function(element, isStage) { | 1132 | value: function(element, isStage) { |
1133 | var xformStr = this.getElementStyle(element, "-webkit-transform", false, isStage), | 1133 | var xformStr = this.getElementStyle(element, "-webkit-transform", true, isStage), |
1134 | mat; | 1134 | mat; |
1135 | 1135 | ||
1136 | if (xformStr) { | 1136 | if (xformStr) { |
@@ -1163,26 +1163,29 @@ var stylesController = exports.StylesController = Montage.create(Component, { | |||
1163 | 1163 | ||
1164 | getPerspectiveDistFromElement : { | 1164 | getPerspectiveDistFromElement : { |
1165 | value: function(element, isStage) { | 1165 | value: function(element, isStage) { |
1166 | var xformStr = this.getElementStyle(element, "-webkit-transform", false, isStage), | 1166 | var xformStr = this.getElementStyle(element, "-webkit-perspective", false, isStage), |
1167 | dist; | 1167 | dist; |
1168 | 1168 | ||
1169 | if (xformStr) { | 1169 | if(xformStr) { |
1170 | var index1 = xformStr.indexOf( "perspective("); | 1170 | dist = parseInt(xformStr); |
1171 | if (index1 >= 0) { | 1171 | } else { |
1172 | index1 += 12; // do not include 'perspective(' | 1172 | xformStr = this.getElementStyle(element, "-webkit-transform", true, isStage); |
1173 | var index2 = xformStr.indexOf( ")", index1 ); | 1173 | if (xformStr) { |
1174 | if (index2 >= 0) { | 1174 | var index1 = xformStr.indexOf( "perspective("); |
1175 | var substr = xformStr.substr( index1, (index2-index1)); | 1175 | if (index1 >= 0) { |
1176 | if (substr && (substr.length > 0)) { | 1176 | index1 += 12; // do not include 'perspective(' |
1177 | dist = parseInt( substr ); | 1177 | var index2 = xformStr.indexOf( ")", index1 ); |
1178 | if (index2 >= 0) { | ||
1179 | var substr = xformStr.substr( index1, (index2-index1)); | ||
1180 | if (substr && (substr.length > 0)) { | ||
1181 | dist = parseInt( substr ); | ||
1182 | } | ||
1178 | } | 1183 | } |
1179 | } | 1184 | } |
1180 | } | 1185 | } |
1181 | } else { | 1186 | } |
1182 | xformStr = this.getElementStyle(element, "-webkit-perspective", false, isStage); | 1187 | if(isNaN(dist)) { |
1183 | if(xformStr) { | 1188 | dist = null; |
1184 | dist = parseInt(xformStr); | ||
1185 | } | ||
1186 | } | 1189 | } |
1187 | return dist; | 1190 | return dist; |
1188 | } | 1191 | } |