mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 17:22:46 +08:00
Make home button route correctly, not respond on middle click
Amends flarum/core#140, closes flarum/core#136
This commit is contained in:
parent
1f9be042dd
commit
06a50e92aa
|
@ -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-secondary'), HeaderSecondary.component());
|
||||
m.mount(id('footer-primary'), FooterPrimary.component());
|
||||
|
|
|
@ -37,7 +37,6 @@ export default class History {
|
|||
|
||||
home() {
|
||||
this.stack.splice(1);
|
||||
var top = this.top();
|
||||
m.route(top.url);
|
||||
m.route('/');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<header class="global-header" id="header">
|
||||
<div id="back-button"></div>
|
||||
<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-secondary" class="header-secondary"></div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue
Block a user