mirror of
https://github.com/flarum/framework.git
synced 2025-03-02 16:57:40 +08:00
Don't affix the sidebar if it is taller than the viewport. fixes #79
This commit is contained in:
parent
d7facbd90a
commit
c9b971bdf8
@ -225,6 +225,11 @@ export default class IndexPage extends Component {
|
||||
affixSidebar(element, isInitialized) {
|
||||
if (isInitialized) { return; }
|
||||
var $sidebar = $(element);
|
||||
|
||||
// Don't affix the sidebar if it is taller than the viewport (otherwise
|
||||
// there would be no way to scroll through its content).
|
||||
if ($sidebar.outerHeight(true) > $(window).height() - $('.global-header').outerHeight(true)) return;
|
||||
|
||||
$sidebar.find('> ul').affix({
|
||||
offset: {
|
||||
top: () => $sidebar.offset().top - $('.global-header').outerHeight(true) - parseInt($sidebar.css('margin-top')),
|
||||
|
Loading…
x
Reference in New Issue
Block a user