Fix Safari header redraw problem. closes flarum/core#187

This commit is contained in:
Toby Zerner 2015-07-28 10:13:58 +09:30
parent 64d4499385
commit 992e515464
2 changed files with 8 additions and 8 deletions

View File

@ -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;
}

View File

@ -229,7 +229,6 @@
left: 0;
right: 0;
z-index: @zindex-header;
.clearfix();
.affix & {
position: fixed;