feat(16-01): wire shortcut:select-all listener in track-list, queue-panel, and playlist-view
- Add handleSelectAll bound handler calling selection.selectAll() in all three components - Register/unregister event listeners in connectedCallback/disconnectedCallback
This commit is contained in:
@@ -277,6 +277,10 @@ export class PlaylistView
|
||||
this.closePlaylistContextMenu();
|
||||
};
|
||||
|
||||
private handleSelectAll = (): void => {
|
||||
this.selection.selectAll();
|
||||
};
|
||||
|
||||
private clearSelectionHandler = (e: MouseEvent) => {
|
||||
const path = e.composedPath();
|
||||
const isTrackClick = path.some(
|
||||
@@ -1196,6 +1200,10 @@ export class PlaylistView
|
||||
'mousedown',
|
||||
this.sortDropdownCloseHandler,
|
||||
);
|
||||
document.addEventListener(
|
||||
'shortcut:select-all',
|
||||
this.handleSelectAll,
|
||||
);
|
||||
}
|
||||
|
||||
override disconnectedCallback() {
|
||||
@@ -1226,6 +1234,10 @@ export class PlaylistView
|
||||
'mousedown',
|
||||
this.sortDropdownCloseHandler,
|
||||
);
|
||||
document.removeEventListener(
|
||||
'shortcut:select-all',
|
||||
this.handleSelectAll,
|
||||
);
|
||||
}
|
||||
|
||||
override updated() {
|
||||
|
||||
Reference in New Issue
Block a user