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; + } + } }