Skip to content

Commit 17aea0e

Browse files
authored
Merge pull request #3146 from danny007in/layout-size-fix
layout size bug fixed
2 parents 3b6279a + 0a70c3c commit 17aea0e

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

build/js/Layout.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const CLASS_NAME_SIDEBAR_FOCUSED = 'sidebar-focused'
3131
const CLASS_NAME_LAYOUT_FIXED = 'layout-fixed'
3232
const CLASS_NAME_CONTROL_SIDEBAR_SLIDE_OPEN = 'control-sidebar-slide-open'
3333
const CLASS_NAME_CONTROL_SIDEBAR_OPEN = 'control-sidebar-open'
34+
const CLASS_NAME_LAYOUT_TOP_NAV = 'layout-top-nav'
3435

3536
const Default = {
3637
scrollbarTheme: 'os-theme-light',
@@ -82,7 +83,11 @@ class Layout {
8283

8384
if (offset !== false) {
8485
if (max === heights.controlSidebar) {
85-
$contentSelector.css(this._config.panelAutoHeightMode, (max + offset))
86+
if ($body.hasClass(CLASS_NAME_LAYOUT_TOP_NAV)) {
87+
$contentSelector.css(this._config.panelAutoHeightMode, (max + offset) + heights.header + heights.footer)
88+
} else {
89+
$contentSelector.css(this._config.panelAutoHeightMode, (max + offset))
90+
}
8691
} else if (max === heights.window) {
8792
$contentSelector.css(this._config.panelAutoHeightMode, (max + offset) - heights.header - heights.footer)
8893
} else {
@@ -164,6 +169,10 @@ class Layout {
164169
this.fixLayoutHeight()
165170
})
166171

172+
$(document).ready(() => {
173+
this.fixLayoutHeight()
174+
})
175+
167176
setTimeout(() => {
168177
$('body.hold-transition').removeClass('hold-transition')
169178
}, 50)

0 commit comments

Comments
 (0)