mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 14:13:37 +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();
|
||||
});
|
||||
|
||||
const offsetTop = $('#app').offset().top + 1;
|
||||
|
||||
// Add a class to the body which indicates that the page has been scrolled
|
||||
// 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
|
||||
// touch devices.
|
||||
$(() => FastClick.attach(document.body));
|
||||
|
||||
$('#app').affix({
|
||||
offset: {top: offsetTop}
|
||||
});
|
||||
|
||||
app.booted = true;
|
||||
}
|
||||
|
|
|
@ -229,7 +229,6 @@
|
|||
left: 0;
|
||||
right: 0;
|
||||
z-index: @zindex-header;
|
||||
.clearfix();
|
||||
|
||||
.affix & {
|
||||
position: fixed;
|
||||
|
|
Loading…
Reference in New Issue
Block a user