You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[chores:fix] Preserve indoor overlay URL fragment on popup close#546
Added configurable fragment preservation support for
bookmarkable actions so indoor map overlays retain
their URL fragment when only the popup nodeId is removed.
Fixes#546
---------
Co-authored-by: Federico Capoano <f.capoano@openwisp.io>
Copy file name to clipboardExpand all lines: README.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -566,6 +566,7 @@ NetJSON format used internally is based on [networkgraph](http://netjson.org/rfc
566
566
id: string,
567
567
zoomOnRestore: boolean,
568
568
zoomLevel: number,
569
+
preserveFragment: boolean,
569
570
}
570
571
```
571
572
@@ -587,7 +588,8 @@ NetJSON format used internally is based on [networkgraph](http://netjson.org/rfc
587
588
588
589
For links, the URL fragment uses the format `source~target` as the `nodeId`. Opening such a URL restores the initial map or graph view and triggers the corresponding link click event.
589
590
590
-
If you need to manually remove the URL fragment, you can call the built-in utility method:`netjsongraphInstance.utils.removeUrlFragment(bookmarkableActions.id);` where you pass the value of your `bookmarkableActions.id` configuration.
591
+
If you need to manually remove the URL fragment, you can call the built-in utility method:`netjsongraphInstance.utils.removeUrlFragment(bookmarkableActions.id);` where you pass the value of your `bookmarkableActions.id`configuration. You can also remove only a specific parameter from the fragment, for example:
592
+
`netjsongraphInstance.utils.removeUrlFragment(bookmarkableActions.id, "nodeId");`. This removes only the `nodeId` parameter from the URL fragment for that specific map while preserving the remaining fragment state. To keep the fragment itself after removing `nodeId`, make sure to set `bookmarkableActions.preserveFragment = true` otherwise, if no additional parameters remain after removing `nodeId`, the entire fragment will be cleaned up automatically.
0 commit comments