mirror of
https://github.com/flarum/core.git
synced 2025-07-21 16:51:34 +02:00
Close the drawer when page content is touched. Fixes #69
This commit is contained in:
@@ -21,12 +21,16 @@ export default function(app) {
|
|||||||
app.pane = new Pane(id('page'));
|
app.pane = new Pane(id('page'));
|
||||||
app.cache = {};
|
app.cache = {};
|
||||||
|
|
||||||
app.signup = () => app.modal.show(new SignupModal());
|
|
||||||
app.login = () => app.modal.show(new LoginModal());
|
|
||||||
|
|
||||||
m.mount(id('back-control'), BackButton.component({ className: 'back-control', drawer: true }));
|
m.mount(id('back-control'), BackButton.component({ className: 'back-control', drawer: true }));
|
||||||
m.mount(id('back-button'), BackButton.component());
|
m.mount(id('back-button'), BackButton.component());
|
||||||
|
|
||||||
|
$('.global-content').click(e => {
|
||||||
|
if ($('body').hasClass('drawer-open')) {
|
||||||
|
e.preventDefault();
|
||||||
|
$('body').removeClass('drawer-open');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
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());
|
||||||
|
@@ -344,6 +344,12 @@ body {
|
|||||||
|
|
||||||
.drawer-open & {
|
.drawer-open & {
|
||||||
margin-left: @drawer-width;
|
margin-left: @drawer-width;
|
||||||
|
|
||||||
|
// Disable all interaction with the content when the drawer is open. When
|
||||||
|
// .global-content is touched, the drawer will be closed.
|
||||||
|
& * {
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user