mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 07:42:48 +08:00
Fix Safari header redraw problem. closes flarum/core#187
This commit is contained in:
parent
64d4499385
commit
992e515464
|
@ -50,19 +50,20 @@ export default function boot(app) {
|
||||||
app.drawer.hide();
|
app.drawer.hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
const offsetTop = $('#app').offset().top + 1;
|
|
||||||
|
|
||||||
// Add a class to the body which indicates that the page has been scrolled
|
// Add a class to the body which indicates that the page has been scrolled
|
||||||
// down.
|
// down.
|
||||||
new ScrollListener(top => $('#app').toggleClass('scrolled', top > offsetTop)).start();
|
new ScrollListener(top => {
|
||||||
|
const $app = $('#app');
|
||||||
|
const offset = $app.offset().top;
|
||||||
|
|
||||||
|
$app
|
||||||
|
.toggleClass('affix', top >= offset)
|
||||||
|
.toggleClass('scrolled', top > offset);
|
||||||
|
}).start();
|
||||||
|
|
||||||
// Initialize FastClick, which makes links and buttons much more responsive on
|
// Initialize FastClick, which makes links and buttons much more responsive on
|
||||||
// touch devices.
|
// touch devices.
|
||||||
$(() => FastClick.attach(document.body));
|
$(() => FastClick.attach(document.body));
|
||||||
|
|
||||||
$('#app').affix({
|
|
||||||
offset: {top: offsetTop}
|
|
||||||
});
|
|
||||||
|
|
||||||
app.booted = true;
|
app.booted = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -229,7 +229,6 @@
|
||||||
left: 0;
|
left: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
z-index: @zindex-header;
|
z-index: @zindex-header;
|
||||||
.clearfix();
|
|
||||||
|
|
||||||
.affix & {
|
.affix & {
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user