Skip to content

Commit e8135f5

Browse files
committed
Adding more eslint comments, and fixing duplicate declarations
1 parent c533b1a commit e8135f5

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

src/timeline/js/controllers.js

+12-11
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929

3030
// Initialize the main controller module
31-
/*global App, timeline, bounding_box, setBoundingBox, moveBoundingBox*/
31+
/*global App, timeline, bounding_box, setBoundingBox, moveBoundingBox, findElement*/
3232
App.controller("TimelineCtrl", function ($scope) {
3333

3434
// DEMO DATA (used when debugging outside of Qt using Chrome)
@@ -183,25 +183,25 @@ App.controller("TimelineCtrl", function ($scope) {
183183
if ("effects" in object) {
184184
for (var effect in object["effects"]) {
185185
// 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)) {
188188
//The current property is not a direct property of p
189189
continue;
190190
}
191191
// 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;
195195
if (co.X >= clip_start_x && co.X <= clip_end_x) {
196196
// Only add keyframe coordinates that are within the bounds of the clip
197197
keyframes[co.X] = co.Y;
198198
}
199199
}
200200
}
201201
// 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;
205205
if (co.X >= clip_start_x && co.X <= clip_end_x) {
206206
// Only add keyframe coordinates that are within the bounds of the clip
207207
keyframes[co.X] = co.Y;
@@ -557,6 +557,7 @@ App.controller("TimelineCtrl", function ($scope) {
557557
if (id !== "" && $scope.enable_razor) {
558558
if ($scope.Qt) {
559559
var cursor_seconds = $scope.getJavaScriptPosition(event.clientX);
560+
/*eslint new-cap: [2, {"capIsNewExceptions": ["timeline.RazorSliceAtCursor"]}]*/
560561
timeline.RazorSliceAtCursor("", id, cursor_seconds);
561562
}
562563
// Don't actually select transition
@@ -1090,15 +1091,15 @@ App.controller("TimelineCtrl", function ($scope) {
10901091
// Loop through diffs (and find the smallest one)
10911092
for (var diff_index = 0; diff_index < diffs.length; diff_index++) {
10921093
var diff = diffs[diff_index].diff;
1093-
var position = diffs[diff_index].position;
1094+
var diff_position = diffs[diff_index].position;
10941095
var abs_diff = Math.abs(diff);
10951096

10961097
// Check if this clip is nearby
10971098
if (abs_diff < smallest_abs_diff && abs_diff <= threshold) {
10981099
// This one is smaller
10991100
smallest_diff = diff;
11001101
smallest_abs_diff = abs_diff;
1101-
snapping_position = position;
1102+
snapping_position = diff_position;
11021103
}
11031104
}
11041105
}

src/timeline/js/directives/transition.js

-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ App.directive("tlTransition", function () {
6868
var vert_scroll_offset = $("#scrolling_tracks").scrollTop();
6969
var track_top = (parseInt(element.position().top, 10) + parseInt(vert_scroll_offset, 10));
7070
var track_bottom = (parseInt(element.position().top, 10) + parseInt(element.height(), 10) + parseInt(vert_scroll_offset, 10));
71-
/*global hasLockedTrack*/
7271
if (hasLockedTrack(scope, track_top, track_bottom)) {
7372
resize_disabled = true;
7473
}

0 commit comments

Comments
 (0)