mirror of
https://github.com/laurent22/joplin.git
synced 2026-06-18 20:16:34 +02:00
Desktop: Improved: When opening a note using Goto Anything, open all its parent notebooks too
This commit is contained in:
@@ -193,13 +193,25 @@ class Dialog extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gotoItem(item) {
|
async gotoItem(item) {
|
||||||
this.props.dispatch({
|
this.props.dispatch({
|
||||||
pluginName: PLUGIN_NAME,
|
pluginName: PLUGIN_NAME,
|
||||||
type: 'PLUGIN_DIALOG_SET',
|
type: 'PLUGIN_DIALOG_SET',
|
||||||
open: false,
|
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) {
|
if (this.state.listType === BaseModel.TYPE_NOTE) {
|
||||||
this.props.dispatch({
|
this.props.dispatch({
|
||||||
type: "FOLDER_AND_NOTE_SELECT",
|
type: "FOLDER_AND_NOTE_SELECT",
|
||||||
|
|||||||
@@ -488,6 +488,12 @@ const reducer = (state = defaultState, action) => {
|
|||||||
newState.collapsedFolderIds = action.ids.slice();
|
newState.collapsedFolderIds = action.ids.slice();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'FOLDER_SET_COLLAPSED':
|
||||||
|
|
||||||
|
newState = Object.assign({}, state);
|
||||||
|
folderSetCollapsed(state, action);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'TAG_UPDATE_ALL':
|
case 'TAG_UPDATE_ALL':
|
||||||
|
|
||||||
newState = Object.assign({}, state);
|
newState = Object.assign({}, state);
|
||||||
|
|||||||
Reference in New Issue
Block a user