Skip to content

Commit

Permalink
Reverting a change from @DylanC (from commit 6a09742), which broke mu…
Browse files Browse the repository at this point in the history
…lti-selection on the timeline.
  • Loading branch information
jonoomph committed Sep 17, 2018
1 parent 6b7b56a commit 3cc472f
Showing 1 changed file with 21 additions and 22 deletions.
43 changes: 21 additions & 22 deletions src/timeline/js/directives/clip.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,14 +268,17 @@ App.directive('tlClip', function($timeout){

bounding_box = {};

// Init all clips whether selected or not
start_clips[$(this).attr('id')] = {"top": $(this).position().top + vert_scroll_offset,
"left": $(this).position().left + horz_scroll_offset};
move_clips[$(this).attr('id')] = {"top": $(this).position().top + vert_scroll_offset,
"left": $(this).position().left + horz_scroll_offset};

//send clip to bounding box builder
setBoundingBox($(this));
// Init all other selected clips (prepare to drag them)
$(".ui-selected").each(function(){
// Init all clips whether selected or not
start_clips[$(this).attr('id')] = {"top": $(this).position().top + vert_scroll_offset,
"left": $(this).position().left + horz_scroll_offset};
move_clips[$(this).attr('id')] = {"top": $(this).position().top + vert_scroll_offset,
"left": $(this).position().left + horz_scroll_offset};

//send clip to bounding box builder
setBoundingBox($(this));
});

// Does this bounding box overlap a locked track?
if (hasLockedTrack(scope, bounding_box.top, bounding_box.bottom) || scope.enable_razor) {
Expand Down Expand Up @@ -321,20 +324,16 @@ App.directive('tlClip', function($timeout){
ui.position.top = results.position.top;

// Move all other selected clips with this one if we have more than one clip
if($(".ui-selected").length > 1) {
$(".ui-selected").each(function() {
var newY = move_clips[$(this).attr('id')]["top"] + y_offset;
var newX = move_clips[$(this).attr('id')]["left"] + x_offset;

//update the clip location in the array
move_clips[$(this).attr('id')]['top'] = newY;
move_clips[$(this).attr('id')]['left'] = newX;

//change the element location
$(this).css('left', newX);
$(this).css('top', newY);
});
}
$(".ui-selected").each(function(){
var newY = move_clips[$(this).attr('id')]["top"] + y_offset;
var newX = move_clips[$(this).attr('id')]["left"] + x_offset;
//update the clip location in the array
move_clips[$(this).attr('id')]['top'] = newY;
move_clips[$(this).attr('id')]['left'] = newX;
//change the element location
$(this).css('left', newX);
$(this).css('top', newY);
});
},
revert: function(valid) {
if(!valid) {
Expand Down

0 comments on commit 3cc472f

Please sign in to comment.