1
0
mirror of https://github.com/BoostIo/Boostnote synced 2025-12-13 01:36:22 +00:00

change color with hover during dragging

This commit is contained in:
Sosuke Suzuki
2017-04-05 10:08:09 +09:00
parent 720f07f62c
commit 50cd0b794b
2 changed files with 21 additions and 1 deletions

View File

@@ -132,7 +132,19 @@ class StorageItem extends React.Component {
}
}
handleDragEnter (e) {
e.dataTransfer.setData("defaultColor", e.target.style.backgroundColor)
e.target.style.backgroundColor = "rgba(129, 130, 131, 0.08)"
}
handleDragLeave (e) {
e.target.style.opacity = "1"
e.target.style.backgroundColor = e.dataTransfer.getData("defaultColor")
}
handleDrop (e, storage, folder, dispatch, location) {
e.target.style.opacity = "1"
e.target.style.backgroundColor = e.dataTransfer.getData("defaultColor")
const noteData = JSON.parse(e.dataTransfer.getData("note"))
if (folder.key !== noteData.folder) {
dataApi
@@ -197,6 +209,8 @@ class StorageItem extends React.Component {
isFolded={isFolded}
noteCount={noteCount}
handleDrop={(e) => this.handleDrop(e, storage, folder, dispatch, location)}
handleDragEnter={this.handleDragEnter}
handleDragLeave={this.handleDragLeave}
/>
)
})