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

Delete folders and tags

This commit is contained in:
Laurent Cozic
2017-11-08 21:22:24 +00:00
parent 7d12da27ad
commit e3554c7aec
20 changed files with 176 additions and 92 deletions

View File

@@ -112,8 +112,8 @@ class AppGui {
if (!nextItem) return; // Normally not possible
let actionType = 'FOLDERS_SELECT';
if (nextItem.type_ === BaseModel.TYPE_TAG) actionType = 'TAGS_SELECT';
let actionType = 'FOLDER_SELECT';
if (nextItem.type_ === BaseModel.TYPE_TAG) actionType = 'TAG_SELECT';
if (nextItem.type_ === BaseModel.TYPE_SEARCH) actionType = 'SEARCH_SELECT';
this.store_.dispatch({
@@ -122,12 +122,12 @@ class AppGui {
});
} else if (item.type_ === Folder.modelType()) {
this.store_.dispatch({
type: 'FOLDERS_SELECT',
type: 'FOLDER_SELECT',
id: item ? item.id : null,
});
} else if (item.type_ === Tag.modelType()) {
this.store_.dispatch({
type: 'TAGS_SELECT',
type: 'TAG_SELECT',
id: item ? item.id : null,
});
} else if (item.type_ === BaseModel.TYPE_SEARCH) {
@@ -160,8 +160,8 @@ class AppGui {
noteList.on('currentItemChange', async () => {
let note = noteList.currentItem;
this.store_.dispatch({
type: 'NOTES_SELECT',
noteId: note ? note.id : null,
type: 'NOTE_SELECT',
id: note ? note.id : null,
});
});
this.rootWidget_.connect(noteList, (state) => {

View File

@@ -324,7 +324,7 @@ class Application extends BaseApplication {
await this.gui_.start();
// Since the settings need to be loaded before the store is created, it will never
// receive the SETTINGS_UPDATE_ALL even, which mean state.settings will not be
// receive the SETTING_UPDATE_ALL even, which mean state.settings will not be
// initialised. So we manually call dispatchUpdateAll() to force an update.
Setting.dispatchUpdateAll();
@@ -333,12 +333,12 @@ class Application extends BaseApplication {
const tags = await Tag.allWithNotes();
this.dispatch({
type: 'TAGS_UPDATE_ALL',
type: 'TAG_UPDATE_ALL',
tags: tags,
});
this.store().dispatch({
type: 'FOLDERS_SELECT',
type: 'FOLDER_SELECT',
id: Setting.value('activeFolderId'),
});
}

View File

@@ -98,8 +98,8 @@ class Command extends BaseCommand {
}
this.dispatch({
type: 'NOTES_SELECT',
noteId: note.id,
type: 'NOTE_SELECT',
id: note.id,
});
await onFinishedEditing();