1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-24 08:12:24 +02:00

Desktop: Improved: When opening a note using Goto Anything, open all its parent notebooks too

This commit is contained in:
Laurent Cozic 2019-05-14 00:11:27 +01:00
parent 5c069c38f5
commit 0e2bb5d784
2 changed files with 19 additions and 1 deletions

View File

@ -193,13 +193,25 @@ class Dialog extends React.PureComponent {
}
}
gotoItem(item) {
async gotoItem(item) {
this.props.dispatch({
pluginName: PLUGIN_NAME,
type: 'PLUGIN_DIALOG_SET',
open: false,
});
if (this.state.listType === BaseModel.TYPE_NOTE || this.state.listType === BaseModel.TYPE_FOLDER) {
const folderPath = await Folder.folderPath(this.props.folders, item.parent_id);
for (const folder of folderPath) {
this.props.dispatch({
type: "FOLDER_SET_COLLAPSED",
id: folder.id,
collapsed: false,
});
}
}
if (this.state.listType === BaseModel.TYPE_NOTE) {
this.props.dispatch({
type: "FOLDER_AND_NOTE_SELECT",

View File

@ -488,6 +488,12 @@ const reducer = (state = defaultState, action) => {
newState.collapsedFolderIds = action.ids.slice();
break;
case 'FOLDER_SET_COLLAPSED':
newState = Object.assign({}, state);
folderSetCollapsed(state, action);
break;
case 'TAG_UPDATE_ALL':
newState = Object.assign({}, state);