Skip to content

Commit 42135d8

Browse files
authored
Bug Fix: Multiple Clips/Transitions Dropped on New Layer (#5092)
* Fix bug preventing multiple clips to be dropped on a new track/layer. * Fix regression caused by dropping multiple clips from different tracks. Also, no longer remove selection after dragging/dropping clips/transitions.
1 parent ffaffa1 commit 42135d8

File tree

1 file changed

+2
-17
lines changed

1 file changed

+2
-17
lines changed

src/timeline/js/directives/track.js

+2-17
Original file line numberDiff line numberDiff line change
@@ -71,29 +71,14 @@ App.directive("tlTrack", function ($timeout) {
7171

7272
// Get uuid to group all these updates as a single transaction
7373
var tid = timeline.get_uuid();
74+
var drop_track_num = -1;
7475

7576
// with each dragged clip, find out which track they landed on
7677
// Loop through each selected item, and remove the selection if multiple items are selected
7778
// If only 1 item is selected, leave it selected
7879
ui_selected.each(function (index) {
7980
var item = $(this);
8081

81-
// Remove all selections
82-
if (ui_selected.length > 1) {
83-
for (var clip_index = 0; clip_index < scope.project.clips.length; clip_index++) {
84-
scope.project.clips[clip_index].selected = false;
85-
if (scope.Qt) {
86-
timeline.removeSelection(scope.project.clips[clip_index].id.replace("clip_", ""), "clip");
87-
}
88-
}
89-
for (var tran_index = 0; tran_index < scope.project.effects.length; tran_index++) {
90-
scope.project.effects[tran_index].selected = false;
91-
if (scope.Qt) {
92-
timeline.removeSelection(scope.project.effects[tran_index].id.replace("transition_", ""), "transition");
93-
}
94-
}
95-
}
96-
9782
// Determine type of item
9883
var item_type = null;
9984
if (item.hasClass("clip")) {
@@ -121,7 +106,7 @@ App.directive("tlTrack", function ($timeout) {
121106
}
122107

123108
// get track the item was dropped on
124-
var drop_track_num = findTrackAtLocation(scope, parseInt(item_middle, 10));
109+
drop_track_num = findTrackAtLocation(scope, parseInt(item_middle, 10));
125110

126111
// if the droptrack was found, update the json
127112
if (drop_track_num !== -1) {

0 commit comments

Comments
 (0)