-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathselection.ts
More file actions
29 lines (26 loc) · 978 Bytes
/
selection.ts
File metadata and controls
29 lines (26 loc) · 978 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import * as State from './state';
import { updatePropertiesPanel } from './propertiesPanel';
export function deselectAllItems() {
State.setSelectedClipId(null);
State.setSelectedOverlayId(null);
document.querySelectorAll('.timeline-clip.is-selected').forEach(el => el.classList.remove('is-selected'));
document.querySelectorAll('.text-overlay.is-selected').forEach(el => el.classList.remove('is-selected'));
updatePropertiesPanel();
}
export function handleSelectClip(clipId: number, element: HTMLDivElement) {
deselectAllItems();
State.setSelectedClipId(clipId);
element.classList.add('is-selected');
updatePropertiesPanel();
}
export function handleSelectOverlay(overlayId: number, element: HTMLDivElement) {
deselectAllItems();
State.setSelectedOverlayId(overlayId);
element.classList.add('is-selected');
updatePropertiesPanel();
}