mirror of
https://github.com/flarum/core.git
synced 2025-07-21 16:51:34 +02:00
Make home button route correctly, not respond on middle click
Amends flarum/core#140, closes flarum/core#136
This commit is contained in:
@@ -35,6 +35,12 @@ export default function(app) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#home-link').click(e => {
|
||||||
|
if (e.ctrlKey || e.metaKey || e.which === 2) return;
|
||||||
|
e.preventDefault();
|
||||||
|
app.history.home();
|
||||||
|
});
|
||||||
|
|
||||||
m.mount(id('header-primary'), HeaderPrimary.component());
|
m.mount(id('header-primary'), HeaderPrimary.component());
|
||||||
m.mount(id('header-secondary'), HeaderSecondary.component());
|
m.mount(id('header-secondary'), HeaderSecondary.component());
|
||||||
m.mount(id('footer-primary'), FooterPrimary.component());
|
m.mount(id('footer-primary'), FooterPrimary.component());
|
||||||
|
@@ -37,7 +37,6 @@ export default class History {
|
|||||||
|
|
||||||
home() {
|
home() {
|
||||||
this.stack.splice(1);
|
this.stack.splice(1);
|
||||||
var top = this.top();
|
m.route('/');
|
||||||
m.route(top.url);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -4,7 +4,7 @@
|
|||||||
<header class="global-header" id="header">
|
<header class="global-header" id="header">
|
||||||
<div id="back-button"></div>
|
<div id="back-button"></div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1 class="header-title"><a href="{{ $config['base_url'] }}" onclick="app.history.home()">{{ $config['forum_title'] }}</a></h1>
|
<h1 class="header-title"><a href="{{ $config['base_url'] }}" id="home-link">{{ $config['forum_title'] }}</a></h1>
|
||||||
<div id="header-primary" class="header-primary"></div>
|
<div id="header-primary" class="header-primary"></div>
|
||||||
<div id="header-secondary" class="header-secondary"></div>
|
<div id="header-secondary" class="header-secondary"></div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user