1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-02 22:49:09 +02:00

Electron: Handle drag and dropping notebooks to change the parent

This commit is contained in:
Laurent Cozic
2018-05-09 09:53:47 +01:00
parent fa9d7b0408
commit 567596643c
11 changed files with 196 additions and 40 deletions

View File

@@ -1,4 +1,5 @@
const ArrayUtils = require('lib/ArrayUtils');
const Folder = require('lib/models/Folder');
let shared = {};
@@ -14,7 +15,7 @@ function renderFoldersRecursive_(props, renderItem, items, parentId, depth) {
const folders = props.folders;
for (let i = 0; i < folders.length; i++) {
let folder = folders[i];
if (folder.parent_id !== parentId) continue;
if (!Folder.idsEqual(folder.parent_id, parentId)) continue;
const hasChildren = folderHasChildren_(folders, folder.id);
items.push(renderItem(folder, props.selectedFolderId == folder.id && props.notesParentType == 'Folder', hasChildren, depth));
if (hasChildren) items = renderFoldersRecursive_(props, renderItem, items, folder.id, depth + 1);