@@ -1244,15 +1244,15 @@ class NetJSONGraphUtil {
12441244 // We store the selected node's data to the browser's history state.
12451245 // This allows the node's information to be retrieved instantly on a back/forward
12461246 // button click without needing to re-parse the entire nodes list.
1247- history . pushState ( state , "" , `#${ newHash } ` ) ;
1247+ window . history . pushState ( state , "" , `#${ newHash } ` ) ;
12481248 }
12491249
12501250 addActionToUrl ( self , params ) {
12511251 if ( ! self . config . bookmarkableActions . enabled || params . data . cluster ) {
12521252 return ;
12531253 }
12541254 const fragments = this . parseUrlFragments ( ) ;
1255- const id = self . config . bookmarkableActions . id ;
1255+ const { id } = self . config . bookmarkableActions ;
12561256 let nodeId ;
12571257 self . indexedNode = self . indexedNode || { } ;
12581258 if ( self . config . render === self . utils . graphRender ) {
@@ -1285,8 +1285,10 @@ class NetJSONGraphUtil {
12851285 if ( ! self . config . bookmarkableActions . enabled || ! Object . keys ( fragments ) . length ) {
12861286 return ;
12871287 }
1288- const id = self . config . bookmarkableActions . id ;
1289- const nodeId = fragments [ id ] ?. get ( "nodeId" ) ;
1288+ const { id} = self . config . bookmarkableActions ;
1289+ const fragmentParams = fragments [ id ] && fragments [ id ] . get ? fragments [ id ] : null ;
1290+ const nodeId =
1291+ fragmentParams && fragmentParams . get ? fragmentParams . get ( "nodeId" ) : undefined ;
12901292 if ( nodeId === node . id ) {
12911293 self . indexedNode = self . indexedNode || { } ;
12921294 self . indexedNode [ nodeId ] = node ;
@@ -1297,9 +1299,11 @@ class NetJSONGraphUtil {
12971299 if ( ! self . config . bookmarkableActions . enabled ) {
12981300 return ;
12991301 }
1300- const id = self . config . bookmarkableActions . id ;
1302+ const { id } = self . config . bookmarkableActions ;
13011303 const fragments = self . utils . parseUrlFragments ( ) ;
1302- const nodeId = fragments [ id ] ?. get ( "nodeId" ) ;
1304+ const fragmentParams = fragments [ id ] && fragments [ id ] . get ? fragments [ id ] : null ;
1305+ const nodeId =
1306+ fragmentParams && fragmentParams . get ? fragmentParams . get ( "nodeId" ) : undefined ;
13031307 if ( ! self . indexedNode || ! self . indexedNode [ nodeId ] ) {
13041308 return ;
13051309 }
0 commit comments