diff --git a/core/frontend/records.js b/core/frontend/records.js index 3d90ee56..4e4e8de4 100644 --- a/core/frontend/records.js +++ b/core/frontend/records.js @@ -38,6 +38,16 @@ window.addEventListener('DOMContentLoaded', () => { unlightNodes(); } }); + // if start_page set, and hash not set, set it on page load, make sure its done after the event listener is registered + if (graphProperties.start_page != "" && window.location.hash == "") { + window.location.hash = graphProperties.start_page; + const recordId = getRecordIdFromHash(); + if (recordId) { + openRecord(recordId); + // comment this out to prevent the jarring translation when clicking on nodes + // zoomToNode(recordId); + } + } function openRecord(id) { const recordContent = document.getElementById(id); diff --git a/core/models/config.js b/core/models/config.js index b74665dd..1cec1a64 100644 --- a/core/models/config.js +++ b/core/models/config.js @@ -72,6 +72,7 @@ module.exports = class Config { css_custom: '', devtools: false, lang: 'en', + start_page: '', }); /**