Added navigation to top/bottom, normalized toplevel node parent to root node
This commit is contained in:
parent
8192f49558
commit
e276e6d156
3 changed files with 54 additions and 11 deletions
|
|
@ -222,11 +222,9 @@ export class NodeStore {
|
|||
}//}}}
|
||||
async getTreeNodes(parent, newLevel) {//{{{
|
||||
return new Promise((resolve, reject) => {
|
||||
// Parent of toplevel nodes is '' in indexedDB,
|
||||
// but can also be set to the ROOT_NODE uuid.
|
||||
// Parent of toplevel nodes is ROOT_NODE in indexedDB.
|
||||
// Only the root node has '' as parent.
|
||||
let storeParent = parent
|
||||
if (parent === ROOT_NODE)
|
||||
storeParent = ''
|
||||
|
||||
const trx = this.db.transaction('nodes', 'readonly')
|
||||
const nodeStore = trx.objectStore('nodes')
|
||||
|
|
@ -305,7 +303,7 @@ export class NodeStore {
|
|||
.transaction('nodes', 'readonly')
|
||||
.objectStore('nodes')
|
||||
|
||||
if (node.ParentUUID === '') {
|
||||
if (node.ParentUUID === ROOT_NODE) {
|
||||
resolve(accumulated)
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue