Skip to content

Commit e027740

Browse files
committed
Add default case form move_clips
1 parent 076075c commit e027740

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/timeline/js/directives/clip.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -331,8 +331,16 @@ App.directive("tlClip", function ($timeout) {
331331

332332
// Move all other selected clips with this one if we have more than one clip
333333
$(".ui-selected").each(function () {
334-
var newY = move_clips[$(this).attr("id")]["top"] + y_offset;
335-
var newX = move_clips[$(this).attr("id")]["left"] + x_offset;
334+
clip_name = $(this).attr("id");
335+
var newX, newY;
336+
if (move_clips[clip_name] && ( move_clips[clip_name]['top'] && move_clips[clip_name]['left'] )) {
337+
newY = move_clips[clip_name]['top'] = this.style.top + y_offset;
338+
newX = move_clips[clip_name]['left'] + y_offset;
339+
} else {
340+
move_clips[clip_name] = {};
341+
newY = this.style.top + y_offset;
342+
newX = this.style.top + y_offset;
343+
}
336344
//update the clip location in the array
337345
move_clips[$(this).attr("id")]["top"] = newY;
338346
move_clips[$(this).attr("id")]["left"] = newX;

0 commit comments

Comments
 (0)