new Store()
The main Mobx State Tree store for the RML application. It holds a static tree and
the fetched tree from the server. The properties are read-only.
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
rootId |
int |
<optional> |
rmlOpts.rootId | The root folder id |
staticTree |
Array.<module:store/TreeNode~TreeNode> | The static tree | ||
tree |
Array.<module:store/TreeNode~TreeNode> |
<optional> |
The tree | |
refs |
object |
<optional> |
Refs to all available tree nodes | |
selectedId |
string | int |
<optional> |
0 | The selected id |
foldersNeedsRefresh |
Array.<mixed> |
<optional> |
Node ids which needs to be refreshed when they gets queried | |
uploading |
Array.<module:store/Upload~Upload> |
<optional> |
The upload queue | |
uploadTotalLoaded |
int |
<optional> |
0 | The upload total loaded |
uploadTotalSize |
int |
<optional> |
0 | The upload total size |
sortables |
object |
<optional> |
Available sortables for the order menu | |
uploadTotalBytesPerSec |
int |
<optional> |
0 | The uploader bytes per second |
selected |
module:store/TreeNode~TreeNode |
<optional> |
The selected tree node | |
currentUpload |
module:store/Upload~Upload |
<optional> |
The current upload file | |
uploadTotalRemainTime |
string |
<optional> |
The current upload remaining time in human readable form | |
readableUploadTotalLoaded |
string |
<optional> |
The uploader total loaded in human readable form | |
readableUploadTotalSize |
string |
<optional> |
The uploader total size in human readable form | |
readableUploadTotalBytesPerSec |
string |
<optional> |
The uploader bytes per second in human readable form |
- Source:
Quick reference
Members
- (async) fetchCounts
- (async) fetchSortables
- (async) fetchTree
- handleSort
- (async) persist
Getters
- getTreeItemById(id, exlucdeStaticopt) → {module:store/TreeNode~TreeNode}
Setters
- setter(callback)
- setTree(tree, isStaticopt)
- setUploadTotal()
Methods
- addFoldersNeedsRefresh()
- addUploading(object) → {object}
- removeFoldersNeedsRefresh()
- removeUploading(cid) → {object}
Members
(async) fetchCounts
Update the folder count. If you pass no argument the folder count is
requested from server.
- Source:
(async) fetchSortables
Fetch sortables.
- Source:
(async) fetchTree
Fetch the folder tree.
- Source:
handleSort
Handle sort mechanism.
- Source:
(async) persist
Create a new tree node.
- Source:
Methods
addFoldersNeedsRefresh()
Register a folder that it needs refresh.
- Source:
addUploading(object) → {object}
Add an uploading file.
Parameters:
Name | Type | Description |
---|---|---|
object |
object | The object to push |
- Source:
Returns:
The upload instance
- Type
- object
getTreeItemById(id, exlucdeStaticopt) → {module:store/TreeNode~TreeNode}
Get tree item by id.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
id |
string | int | |||
exlucdeStatic |
boolean |
<optional> |
true |
- Source:
Returns:
Tree node
removeFoldersNeedsRefresh()
Register a folder that it needs refresh.
- Source:
removeUploading(cid) → {object}
Remove an uploading file from queue.
Parameters:
Name | Type | Description |
---|---|---|
cid |
string | The cid |
- Source:
Returns:
A copy of the original object
- Type
- object
setter(callback)
Update this node attributes.
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | The callback with one argument (node draft) |
- Source:
setTree(tree, isStaticopt)
Set the tree.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
tree |
object | The object representing a tree | ||
isStatic |
boolean |
<optional> |
false |
- Source:
setUploadTotal()
Set upload total stats.
- Source: