@@ -1244,15 +1244,15 @@ class NetJSONGraphUtil {
1244
1244
// We store the selected node's data to the browser's history state.
1245
1245
// This allows the node's information to be retrieved instantly on a back/forward
1246
1246
// button click without needing to re-parse the entire nodes list.
1247
- history . pushState ( state , "" , `#${ newHash } ` ) ;
1247
+ window . history . pushState ( state , "" , `#${ newHash } ` ) ;
1248
1248
}
1249
1249
1250
1250
addActionToUrl ( self , params ) {
1251
1251
if ( ! self . config . bookmarkableActions . enabled || params . data . cluster ) {
1252
1252
return ;
1253
1253
}
1254
1254
const fragments = this . parseUrlFragments ( ) ;
1255
- const id = self . config . bookmarkableActions . id ;
1255
+ const { id } = self . config . bookmarkableActions ;
1256
1256
let nodeId ;
1257
1257
self . indexedNode = self . indexedNode || { } ;
1258
1258
if ( self . config . render === self . utils . graphRender ) {
@@ -1285,8 +1285,10 @@ class NetJSONGraphUtil {
1285
1285
if ( ! self . config . bookmarkableActions . enabled || ! Object . keys ( fragments ) . length ) {
1286
1286
return ;
1287
1287
}
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 ;
1290
1292
if ( nodeId === node . id ) {
1291
1293
self . indexedNode = self . indexedNode || { } ;
1292
1294
self . indexedNode [ nodeId ] = node ;
@@ -1297,9 +1299,11 @@ class NetJSONGraphUtil {
1297
1299
if ( ! self . config . bookmarkableActions . enabled ) {
1298
1300
return ;
1299
1301
}
1300
- const id = self . config . bookmarkableActions . id ;
1302
+ const { id } = self . config . bookmarkableActions ;
1301
1303
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 ;
1303
1307
if ( ! self . indexedNode || ! self . indexedNode [ nodeId ] ) {
1304
1308
return ;
1305
1309
}
0 commit comments