mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-14 02:06:29 +00:00
saving new order in the storage only for now
This commit is contained in:
@@ -2,7 +2,7 @@ import React, { PropTypes } from 'react'
|
|||||||
import CSSModules from 'browser/lib/CSSModules'
|
import CSSModules from 'browser/lib/CSSModules'
|
||||||
import styles from './FolderList.styl'
|
import styles from './FolderList.styl'
|
||||||
import FolderItem from './FolderItem'
|
import FolderItem from './FolderItem'
|
||||||
import { SortableContainer } from 'react-sortable-hoc'
|
import { SortableContainer, arrayMove } from 'react-sortable-hoc'
|
||||||
|
|
||||||
class FolderList extends React.Component {
|
class FolderList extends React.Component {
|
||||||
constructor (props) {
|
constructor (props) {
|
||||||
@@ -58,7 +58,9 @@ class SortableFolderListComponent extends React.Component {
|
|||||||
constructor (props) {
|
constructor (props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.onSortEnd = ({oldIndex, newIndex}) => {
|
this.onSortEnd = ({oldIndex, newIndex}) => {
|
||||||
console.log("end")
|
let { storage } = this.props
|
||||||
|
storage.folders = arrayMove(storage.folders, oldIndex, newIndex)
|
||||||
|
this.setState()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user