mirror of
https://github.com/flarum/core.git
synced 2025-10-12 07:24:27 +02:00
Roughly implement routes and data preloading
Only preloading data for basic requests w/o query params, at least for the moment - if we have to preload for something like /?q=test&sort=newest, we end up having to duplicate a whole lot of logic between JS/PHP.
This commit is contained in:
@@ -18,8 +18,11 @@ export default function(app) {
|
||||
|
||||
app.history = new History();
|
||||
app.pane = new Pane(id('page'));
|
||||
app.search = new SearchBox();
|
||||
app.cache = {};
|
||||
|
||||
m.startComputation();
|
||||
|
||||
m.mount(id('back-control'), BackButton.component({ className: 'back-control', drawer: true }));
|
||||
m.mount(id('back-button'), BackButton.component());
|
||||
|
||||
@@ -39,10 +42,12 @@ export default function(app) {
|
||||
app.modal = m.mount(id('modal'), Modal.component());
|
||||
app.alerts = m.mount(id('alerts'), Alerts.component());
|
||||
|
||||
m.route.mode = 'hash';
|
||||
m.route.mode = 'pathname';
|
||||
m.route(id('content'), '/', mapRoutes(app.routes));
|
||||
|
||||
app.search = new SearchBox();
|
||||
m.endComputation();
|
||||
|
||||
new ScrollListener(top => $('body').toggleClass('scrolled', top > 0)).start();
|
||||
|
||||
app.booted = true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user