mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-15 10:46:32 +00:00
Several small fixes
This commit is contained in:
@@ -43,7 +43,7 @@ const TagElementList = (tags) => {
|
|||||||
* @param {Function} handleDragStart
|
* @param {Function} handleDragStart
|
||||||
* @param {string} dateDisplay
|
* @param {string} dateDisplay
|
||||||
*/
|
*/
|
||||||
const NoteItem = ({ isActive, note, dateDisplay, handleNoteClick, handleNoteContextMenu, handleDragStart}) => (
|
const NoteItem = ({ isActive, note, dateDisplay, handleNoteClick, handleNoteContextMenu, handleDragStart }) => (
|
||||||
<div styleName={isActive
|
<div styleName={isActive
|
||||||
? 'item--active'
|
? 'item--active'
|
||||||
: 'item'
|
: 'item'
|
||||||
@@ -52,7 +52,7 @@ const NoteItem = ({ isActive, note, dateDisplay, handleNoteClick, handleNoteCont
|
|||||||
onClick={e => handleNoteClick(e, `${note.storage}-${note.key}`)}
|
onClick={e => handleNoteClick(e, `${note.storage}-${note.key}`)}
|
||||||
onContextMenu={e => handleNoteContextMenu(e, `${note.storage}-${note.key}`)}
|
onContextMenu={e => handleNoteContextMenu(e, `${note.storage}-${note.key}`)}
|
||||||
onDragStart={e => handleDragStart(e, note)}
|
onDragStart={e => handleDragStart(e, note)}
|
||||||
draggable="true"
|
draggable='true'
|
||||||
>
|
>
|
||||||
<div styleName='item-wrapper'>
|
<div styleName='item-wrapper'>
|
||||||
<div styleName='item-bottom-time'>{dateDisplay}</div>
|
<div styleName='item-bottom-time'>{dateDisplay}</div>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ const NoteItemSimple = ({ isActive, note, handleNoteClick, handleNoteContextMenu
|
|||||||
onClick={e => handleNoteClick(e, `${note.storage}-${note.key}`)}
|
onClick={e => handleNoteClick(e, `${note.storage}-${note.key}`)}
|
||||||
onContextMenu={e => handleNoteContextMenu(e, `${note.storage}-${note.key}`)}
|
onContextMenu={e => handleNoteContextMenu(e, `${note.storage}-${note.key}`)}
|
||||||
onDragStart={e => handleDragStart(e, note)}
|
onDragStart={e => handleDragStart(e, note)}
|
||||||
draggable="true"
|
draggable='true'
|
||||||
>
|
>
|
||||||
<div styleName='item-simple-title'>
|
<div styleName='item-simple-title'>
|
||||||
{note.type === 'SNIPPET_NOTE'
|
{note.type === 'SNIPPET_NOTE'
|
||||||
|
|||||||
@@ -351,7 +351,7 @@ class NoteList extends React.Component {
|
|||||||
|
|
||||||
handleDragStart (e, note) {
|
handleDragStart (e, note) {
|
||||||
const noteData = JSON.stringify(note)
|
const noteData = JSON.stringify(note)
|
||||||
e.dataTransfer.setData("note", noteData)
|
e.dataTransfer.setData('note', noteData)
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
|||||||
@@ -133,19 +133,19 @@ class StorageItem extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleDragEnter (e) {
|
handleDragEnter (e) {
|
||||||
e.dataTransfer.setData("defaultColor", e.target.style.backgroundColor)
|
e.dataTransfer.setData('defaultColor', e.target.style.backgroundColor)
|
||||||
e.target.style.backgroundColor = "rgba(129, 130, 131, 0.08)"
|
e.target.style.backgroundColor = 'rgba(129, 130, 131, 0.08)'
|
||||||
}
|
}
|
||||||
|
|
||||||
handleDragLeave (e) {
|
handleDragLeave (e) {
|
||||||
e.target.style.opacity = "1"
|
e.target.style.opacity = '1'
|
||||||
e.target.style.backgroundColor = e.dataTransfer.getData("defaultColor")
|
e.target.style.backgroundColor = e.dataTransfer.getData('defaultColor')
|
||||||
}
|
}
|
||||||
|
|
||||||
handleDrop (e, storage, folder, dispatch, location) {
|
handleDrop (e, storage, folder, dispatch, location) {
|
||||||
e.target.style.opacity = "1"
|
e.target.style.opacity = '1'
|
||||||
e.target.style.backgroundColor = e.dataTransfer.getData("defaultColor")
|
e.target.style.backgroundColor = e.dataTransfer.getData('defaultColor')
|
||||||
const noteData = JSON.parse(e.dataTransfer.getData("note"))
|
const noteData = JSON.parse(e.dataTransfer.getData('note'))
|
||||||
if (folder.key !== noteData.folder) {
|
if (folder.key !== noteData.folder) {
|
||||||
dataApi
|
dataApi
|
||||||
.createNote(storage.key, {
|
.createNote(storage.key, {
|
||||||
|
|||||||
Reference in New Issue
Block a user