make drag&drop transfer entire object
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { Card, CardContent, Grid, styled, Typography } from "@mui/material"
|
import { Card, CardContent, Grid, styled, Typography } from "@mui/material"
|
||||||
import React from "react"
|
import React from "react"
|
||||||
import instructions, { Instruction } from "../Instructions"
|
import instructions, { Instruction } from "../instructions"
|
||||||
import Tooltip, { TooltipProps, tooltipClasses } from "@mui/material/Tooltip"
|
import Tooltip, { TooltipProps, tooltipClasses } from "@mui/material/Tooltip"
|
||||||
import { SIDEBAR_WIDTH } from "../const"
|
import { SIDEBAR_WIDTH } from "../const"
|
||||||
|
|
||||||
@@ -36,7 +36,7 @@ function handleDragStart(
|
|||||||
}
|
}
|
||||||
|
|
||||||
event.dataTransfer.dropEffect = "copy"
|
event.dataTransfer.dropEffect = "copy"
|
||||||
event.dataTransfer.setData("text/plain", instruction.symbol)
|
event.dataTransfer.setData("instruction", JSON.stringify(instruction))
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function InstructionMenu() {
|
export default function InstructionMenu() {
|
||||||
@@ -45,7 +45,7 @@ export default function InstructionMenu() {
|
|||||||
return (
|
return (
|
||||||
<div style={sideBar}>
|
<div style={sideBar}>
|
||||||
<Grid container columns={2}>
|
<Grid container columns={2}>
|
||||||
{instructions.map((instruction: Instruction) => {
|
{instructions.slice(1).map((instruction: Instruction) => {
|
||||||
return (
|
return (
|
||||||
<Grid item key={key++} xs={1}>
|
<Grid item key={key++} xs={1}>
|
||||||
<HtmlTooltip
|
<HtmlTooltip
|
||||||
|
|||||||
Reference in New Issue
Block a user