diff --git a/frontend/src/aspects/exploration.ts b/frontend/src/aspects/exploration.ts index 2aab8b39..a5724355 100644 --- a/frontend/src/aspects/exploration.ts +++ b/frontend/src/aspects/exploration.ts @@ -7,6 +7,7 @@ import mainRouter from '../global/main-router'; import explorer from '../global/explorer-view'; import controller from '../global/explorer-controller'; import { ensureSources } from '../global/sources'; +import sourceListPanel from '../global/source-list-view'; const browserHistory = window.history; @@ -39,7 +40,15 @@ channel.on('currentRoute', (route, panel) => { browserHistory.replaceState(panel.cid, document.title); }); -mainRouter.on('route:explore', () => ensureSources()); +mainRouter.on('route:explore', () => { + ensureSources(); + const cid = sourceListPanel.cid; + if (explorer.has(cid)) { + explorer.scroll(cid); + } else { + explorer.reset(sourceListPanel); + } +}); router.on('route', (route, [serial]) => { const state = browserHistory.state; diff --git a/frontend/src/global/explorer-view.ts b/frontend/src/global/explorer-view.ts index 633f30d3..dc78f2e8 100644 --- a/frontend/src/global/explorer-view.ts +++ b/frontend/src/global/explorer-view.ts @@ -1,4 +1,4 @@ +import View from '../core/view'; import ExplorerView from '../explorer/explorer-view'; -import sourceListView from '../global/source-list-view'; -export default new ExplorerView({ first: sourceListView }); +export default new ExplorerView({ first: new View() });