Open kisst opened 4 years ago
Working on this in https://github.com/JSomerstone/mindmap/tree/feature/navigation
@JSomerstone just merged it, but discovered a small bug, the setting up the root
url parameter is ignoring any existing url parameters like src_data
or initial
Given an data2.yaml as source data, set as source by ?src_data=data2.yaml
, when zooming in into the sub-key
within data2, the url should be ?src_data=data2.yaml&root=sub-key
not just ?root=sub-key
, but to complicate matters further, the initial
parameter would be either need to be modified, or removed, as the root does override the sources data, hence root + initial have to be changed in sync.
Now one of the alternative is move the config option of the data src location, either into the html directly or somewhere else, because let's be frank, that is a rare use-case, or we need to smarten up more the url amending.
@evenicoulddoit @anttisalo what do you think ? :thinking:
Moving from links to dynamically editing the query parameters would be the solution IMO.
setting document.location.search
in combination with URLSearchParam.set()
should do the trick (https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/set)
Made new PR: https://github.com/kisst/mindmap/pull/23
The edit this parameter in the URL query parameters works for some, but not an option for everyone, a gui option to fabricate this parameters is needed for at least the following.
For the file item, a simple file picker should work, for the root item picker, that's two fold. One is to limit the scope aka zoom in, that can be done with a left-click option "hide parents" or "set as root", and the other half is the zoom out, which could be done either with a history navigation bar, or with a side menu.