mirror of
https://github.com/xallt/sync-graph-settings.git
synced 2026-07-22 07:10:28 +00:00
Merge pull request #6 from isdmg/master
Also sync `close` setting from global graph, responsible for whether the graph settings panel is closed/open
This commit is contained in:
commit
e57cc920ee
1 changed files with 4 additions and 2 deletions
6
main.ts
6
main.ts
|
|
@ -121,8 +121,9 @@ export default class SyncGraphPlugin extends Plugin {
|
|||
const graphConfig = JSON.parse(graphConfigJson);
|
||||
const graphColorGroups = graphConfig.colorGroups;
|
||||
const searchFilters = graphConfig.search;
|
||||
const closeSettings = graphConfig.close;
|
||||
this.getLocalGraphLeaves().forEach((leaf) => {
|
||||
this.setSettings(leaf, graphColorGroups, searchFilters);
|
||||
this.setSettings(leaf, graphColorGroups, searchFilters, closeSettings);
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -130,10 +131,11 @@ export default class SyncGraphPlugin extends Plugin {
|
|||
return this.app.workspace.getLeavesOfType('localgraph');
|
||||
}
|
||||
|
||||
setSettings(localGraphLeaf: WorkspaceLeaf, colorGroups: any, searchFilters: any) {
|
||||
setSettings(localGraphLeaf: WorkspaceLeaf, colorGroups: any, searchFilters: any, closeSettings: any) {
|
||||
const viewState = localGraphLeaf.getViewState();
|
||||
viewState.state.options.colorGroups = colorGroups;
|
||||
viewState.state.options.search = searchFilters;
|
||||
viewState.state.options.close = closeSettings;
|
||||
|
||||
viewState.state.options.localJumps = this.settings.defaultDepth;
|
||||
viewState.state.options.localBacklinks = this.settings.defaultIncomingLinks;
|
||||
|
|
|
|||
Loading…
Reference in a new issue