|
28 | 28 |
|
29 | 29 |
|
30 | 30 | // Initialize the main controller module
|
31 |
| -/*global App, timeline, bounding_box, setBoundingBox, moveBoundingBox*/ |
| 31 | +/*global App, timeline, bounding_box, setBoundingBox, moveBoundingBox, findElement*/ |
32 | 32 | App.controller("TimelineCtrl", function ($scope) {
|
33 | 33 |
|
34 | 34 | // DEMO DATA (used when debugging outside of Qt using Chrome)
|
@@ -183,25 +183,25 @@ App.controller("TimelineCtrl", function ($scope) {
|
183 | 183 | if ("effects" in object) {
|
184 | 184 | for (var effect in object["effects"]) {
|
185 | 185 | // Loop through properties of an effect, looking for keyframe points
|
186 |
| - for (var child in object["effects"][effect]) { |
187 |
| - if (!object["effects"][effect].hasOwnProperty(child)) { |
| 186 | + for (var effect_prop in object["effects"][effect]) { |
| 187 | + if (!object["effects"][effect].hasOwnProperty(effect_prop)) { |
188 | 188 | //The current property is not a direct property of p
|
189 | 189 | continue;
|
190 | 190 | }
|
191 | 191 | // Determine if this property is a Keyframe
|
192 |
| - if (typeof object["effects"][effect][child] === "object" && "Points" in object["effects"][effect][child]) { |
193 |
| - for (var point = 0; point < object["effects"][effect][child].Points.length; point++) { |
194 |
| - var co = object["effects"][effect][child].Points[point].co; |
| 192 | + if (typeof object["effects"][effect][effect_prop] === "object" && "Points" in object["effects"][effect][effect_prop]) { |
| 193 | + for (var point = 0; point < object["effects"][effect][effect_prop].Points.length; point++) { |
| 194 | + var co = object["effects"][effect][effect_prop].Points[point].co; |
195 | 195 | if (co.X >= clip_start_x && co.X <= clip_end_x) {
|
196 | 196 | // Only add keyframe coordinates that are within the bounds of the clip
|
197 | 197 | keyframes[co.X] = co.Y;
|
198 | 198 | }
|
199 | 199 | }
|
200 | 200 | }
|
201 | 201 | // Determine if this property is a Color Keyframe
|
202 |
| - if (typeof object["effects"][effect][child] === "object" && "red" in object["effects"][effect][child]) { |
203 |
| - for (var point = 0; point < object["effects"][effect][child]["red"].Points.length; point++) { |
204 |
| - var co = object["effects"][effect][child]["red"].Points[point].co; |
| 202 | + if (typeof object["effects"][effect][effect_prop] === "object" && "red" in object["effects"][effect][effect_prop]) { |
| 203 | + for (var point = 0; point < object["effects"][effect][effect_prop]["red"].Points.length; point++) { |
| 204 | + var co = object["effects"][effect][effect_prop]["red"].Points[point].co; |
205 | 205 | if (co.X >= clip_start_x && co.X <= clip_end_x) {
|
206 | 206 | // Only add keyframe coordinates that are within the bounds of the clip
|
207 | 207 | keyframes[co.X] = co.Y;
|
@@ -557,6 +557,7 @@ App.controller("TimelineCtrl", function ($scope) {
|
557 | 557 | if (id !== "" && $scope.enable_razor) {
|
558 | 558 | if ($scope.Qt) {
|
559 | 559 | var cursor_seconds = $scope.getJavaScriptPosition(event.clientX);
|
| 560 | + /*eslint new-cap: [2, {"capIsNewExceptions": ["timeline.RazorSliceAtCursor"]}]*/ |
560 | 561 | timeline.RazorSliceAtCursor("", id, cursor_seconds);
|
561 | 562 | }
|
562 | 563 | // Don't actually select transition
|
@@ -1090,15 +1091,15 @@ App.controller("TimelineCtrl", function ($scope) {
|
1090 | 1091 | // Loop through diffs (and find the smallest one)
|
1091 | 1092 | for (var diff_index = 0; diff_index < diffs.length; diff_index++) {
|
1092 | 1093 | var diff = diffs[diff_index].diff;
|
1093 |
| - var position = diffs[diff_index].position; |
| 1094 | + var diff_position = diffs[diff_index].position; |
1094 | 1095 | var abs_diff = Math.abs(diff);
|
1095 | 1096 |
|
1096 | 1097 | // Check if this clip is nearby
|
1097 | 1098 | if (abs_diff < smallest_abs_diff && abs_diff <= threshold) {
|
1098 | 1099 | // This one is smaller
|
1099 | 1100 | smallest_diff = diff;
|
1100 | 1101 | smallest_abs_diff = abs_diff;
|
1101 |
| - snapping_position = position; |
| 1102 | + snapping_position = diff_position; |
1102 | 1103 | }
|
1103 | 1104 | }
|
1104 | 1105 | }
|
|
0 commit comments