From 97bf70a2aae3385ce94f8b507ee778debfbc6092 Mon Sep 17 00:00:00 2001 From: NeoCoderMatrix86 <40752681+NeoCoderMatrix86@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:59:44 +0100 Subject: [PATCH] Update TrackListItem.razor --- .../Shared/TrackList/TrackListItem.razor | 45 +++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/AudioCuesheetEditor/Shared/TrackList/TrackListItem.razor b/AudioCuesheetEditor/Shared/TrackList/TrackListItem.razor index 3ad3ab2f..d6d429fa 100644 --- a/AudioCuesheetEditor/Shared/TrackList/TrackListItem.razor +++ b/AudioCuesheetEditor/Shared/TrackList/TrackListItem.razor @@ -25,13 +25,14 @@ along with Foobar. If not, see @inject MusicBrainzDataProvider _musicBrainzDataProvider @inject ITextLocalizerService _localizationService @inject ILocalStorageOptionsProvider _localStorageOptionsProvider +@inject ILogger _logger @if (Cuesheet != null) { - + @@ -130,11 +131,14 @@ along with Foobar. If not, see @code { - //TODO: Hier drag und drop beispiel angepasst einfügen + //TODO: Drag border korrigieren + //TODO: Drag over eingabelement sorgt für löschen des dragOverTracks EditTrackModal? modalTrackEdit; Validations? validations; IEnumerable? autocompleteTrackArtists; IEnumerable? autocompleteTrackTitles; + Track? draggedTrack; + Track? dragOverTrack; public void Dispose() { @@ -293,9 +297,44 @@ along with Foobar. If not, see { StateHasChanged(); } - + void TraceChangeManager_RedoDone(object? sender, EventArgs args) { StateHasChanged(); } + + void OnDragStart(Track track) + { + _logger.LogDebug("OnDragStart: {0}", track.Position); + draggedTrack = track; + } + + void OnDrop(Track track) + { + //TODO: verschieben der tracks! + draggedTrack = null; + dragOverTrack = null; + } + + void OnDragEnter(Track track) + { + _logger.LogDebug("OnDragEnter: {0}", track.Position); + dragOverTrack = track; + } + + void OnDragOver(Track track) + { + _logger.LogDebug("OnDragOver: {0}", track.Position); + dragOverTrack = track; + } + + void OnDragLeave(Track track) + { + _logger.LogDebug("OnDragLeave: {0}", track.Position); + if (track == dragOverTrack) + { + _logger.LogDebug("track == dragOverTrack"); + dragOverTrack = null; + } + } }