1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-26 22:41:17 +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

@@ -107,7 +107,7 @@ class NotesScreenComponent extends BaseScreenComponent {
}
deleteFolder_onPress(folderId) {
dialogs.confirm(this, _('Delete notebook? All notes within this notebook will also be deleted.')).then((ok) => {
dialogs.confirm(this, _('Delete notebook? All notes and sub-notebooks within this notebook will also be deleted.')).then((ok) => {
if (!ok) return;
Folder.delete(folderId).then(() => {

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);