Update Drag

pull/9/head
Louis DUFOUR 3 years ago
parent 606539f538
commit 9b1388982b

@ -56,7 +56,7 @@ namespace ValblazeProject.Components
//Parent.CheckRecipe();
}
private void OnDragStart()
internal void OnDragStart()
{
Parent.CurrentDragItem = this.Item;

@ -1,4 +1,6 @@
.item {
display: flex;
justify-content: center;
width: 64px;
height: 64px;
border: 1px solid;

@ -45,6 +45,7 @@
@if (!string.IsNullOrWhiteSpace(context.ImageBase64))
{
<div
class="item"
ondragover="event.preventDefault();"
draggable="true"
@ondragstart="@OnDragStart"

@ -14,6 +14,7 @@ using Microsoft.AspNetCore.Components.Forms;
using System.Linq;
using Microsoft.JSInterop;
using System.Collections.Specialized;
using Microsoft.AspNetCore.Components.Web;
namespace ValblazeProject.Pages
{
@ -49,6 +50,8 @@ namespace ValblazeProject.Pages
private int totalSizeByPage = 10;
private bool _trie = false;
// Autre
public ObservableCollection<CraftingAction> Actions { get; set; }
public Item CurrentDragItem { get; set; }
@ -65,10 +68,24 @@ namespace ValblazeProject.Pages
}
// Drag
internal void OnDragEnter() { }
internal void OnDragStart() { }
internal void OnDrop() { }
internal void OnDragLeave() { }
private CraftingItem Drag;
public void OnDragEnter()
{
Drag.OnDragEnter();
}
public void OnDragStart()
{
Drag.OnDragStart();
}
public void OnDrop()
{
Drag.OnDrop();
}
public void OnDragLeave()
{
Drag.OnDragLeave();
}
/******************* Attribut modifier *******************/

@ -35,4 +35,13 @@
height: 250px;
overflow: scroll;
margin-right: 20px;
}
}
.item {
display: flex;
justify-content: center;
width: 64px;
height: 64px;
border: 1px solid;
overflow: hidden;
}

Loading…
Cancel
Save