From 452532672a8358fddf1b3d151529f2b75fff658f Mon Sep 17 00:00:00 2001 From: Julian Gonggrijp Date: Thu, 13 Aug 2020 12:52:53 +0200 Subject: [PATCH] Add exploration aspect, navigate on scroll (#62, #106) --- frontend/src/aspects/exploration.ts | 7 +++++++ frontend/src/aspects/navigation.ts | 1 - frontend/src/main.ts | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 frontend/src/aspects/exploration.ts diff --git a/frontend/src/aspects/exploration.ts b/frontend/src/aspects/exploration.ts new file mode 100644 index 00000000..b1ff4220 --- /dev/null +++ b/frontend/src/aspects/exploration.ts @@ -0,0 +1,7 @@ +import channel from '../explorer/radio'; + +import router from '../global/exploration-router'; +import explorer from '../global/explorer-view'; +import '../global/explorer-controller'; + +channel.on('currentRoute', route => router.navigate(route)); diff --git a/frontend/src/aspects/navigation.ts b/frontend/src/aspects/navigation.ts index bda42d0f..59123a82 100644 --- a/frontend/src/aspects/navigation.ts +++ b/frontend/src/aspects/navigation.ts @@ -11,7 +11,6 @@ import mainRouter from '../global/main-router'; import userFsm from '../global/user-fsm'; import { ensureSources } from '../global/sources'; import explorerView from '../global/explorer-view'; -import '../global/explorer-controller'; history.once('route', () => { menuView.render().$el.appendTo('#header'); diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 91746413..a1dcc420 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -3,16 +3,17 @@ import { when, ready } from 'jquery'; import '@dhl-uu/jquery-promise'; import { baseUrl } from 'config.json'; +import './core/scroll-easings'; import { i18nPromise } from './global/i18n'; import './global/internalLinks'; import './global/hbsHelpers'; import user from './global/user'; import { prefetch } from './global/ld-store'; import './global/item-cache'; -import './core/scroll-easings'; import './aspects/navigation'; import './aspects/authentication'; import './aspects/registration'; +import './aspects/exploration'; when(ready, i18nPromise).done(function () { user.fetch();