1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-15 23:00:36 +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

@ -44,6 +44,15 @@ class BaseModel {
return null;
}
// Prefer the use of this function to compare IDs as it handles the case where
// one ID is null and the other is "", in which case they are actually considered to be the same.
static idsEqual(id1, id2) {
if (!id1 && !id2) return true;
if (!id1 && !!id2) return false;
if (!!id1 && !id2) return false;
return id1 === id2;
}
static modelTypeToName(type) {
for (let i = 0; i < BaseModel.typeEnum_.length; i++) {
const e = BaseModel.typeEnum_[i];