|
|
@ -16,6 +16,7 @@ namespace BlazorApp.Components
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[Parameter]
|
|
|
|
[Parameter]
|
|
|
|
public bool NoDrop { get; set; }
|
|
|
|
public bool NoDrop { get; set; }
|
|
|
|
|
|
|
|
|
|
|
@ -44,6 +45,7 @@ namespace BlazorApp.Components
|
|
|
|
|
|
|
|
|
|
|
|
internal void OnDrop()
|
|
|
|
internal void OnDrop()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
if (NoDrop == true || Parent.CurrentDragItem == null)
|
|
|
|
if (NoDrop == true || Parent.CurrentDragItem == null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
return;
|
|
|
@ -58,12 +60,6 @@ namespace BlazorApp.Components
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (this.Item.Id != Parent.CurrentDragItem.Id)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Item temp = ItemFactory.Create(this.Item);
|
|
|
|
|
|
|
|
this.Item = ItemFactory.Create(Parent.CurrentDragItem);
|
|
|
|
|
|
|
|
Parent.CurrentDragItem = ItemFactory.Create(temp);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "Drop", Item = this.Item, Index = this.Index });
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "Drop", Item = this.Item, Index = this.Index });
|
|
|
@ -78,5 +74,14 @@ namespace BlazorApp.Components
|
|
|
|
|
|
|
|
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "Drag Start", Item = this.Item, Index = this.Index });
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "Drag Start", Item = this.Item, Index = this.Index });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void OnDragEnd()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (Parent.Actions.Last().Action == "Drag Leave")
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
this.Item = null;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Parent.Actions.Add(new InventoryAction { Action = "Delete", Item = this.Item, Index = this.Index });
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|