fix whitespace with fixed navbar & footer

pull/2668/head^2
REJack 2020-04-27 19:28:05 +02:00
parent bf2bafa96c
commit 26ce58fe28
10 changed files with 356 additions and 58 deletions

View File

@ -104,6 +104,9 @@ const Layout = (($) => {
} else { } else {
$(Selector.CONTENT).css('min-height', (max + offset) - heights.header) $(Selector.CONTENT).css('min-height', (max + offset) - heights.header)
} }
if (this._isFooterFixed()) {
$(Selector.CONTENT).css('min-height', parseFloat($(Selector.CONTENT).css('min-height')) + heights.footer);
}
} }
if ($('body').hasClass(ClassName.LAYOUT_FIXED)) { if ($('body').hasClass(ClassName.LAYOUT_FIXED)) {
@ -186,6 +189,10 @@ const Layout = (($) => {
return max return max
} }
_isFooterFixed() {
return $('.main-footer').css('position') === 'fixed';
}
// Static // Static
static _jQueryInterface(config = '') { static _jQueryInterface(config = '') {

View File

@ -91,11 +91,11 @@ body,
body:not(.layout-fixed).layout-navbar-fixed & { body:not(.layout-fixed).layout-navbar-fixed & {
.main-sidebar { .main-sidebar {
margin-top: calc(#{$main-header-height} / -1); // margin-top: calc(#{$main-header-height} / -1);
.sidebar { // .sidebar {
margin-top: $main-header-height; // margin-top: $main-header-height;
} // }
} }
} }
@ -301,13 +301,13 @@ body,
} }
body:not(.layout-fixed).layout#{$infix}-navbar-fixed & { body:not(.layout-fixed).layout#{$infix}-navbar-fixed & {
.main-sidebar { // .main-sidebar {
margin-top: calc(#{$main-header-height} / -1); // margin-top: calc(#{$main-header-height} / -1);
.sidebar { // .sidebar {
margin-top: $main-header-height; // margin-top: $main-header-height;
} // }
} // }
} }
body:not(.layout-fixed).layout#{$infix}-navbar-fixed.text-sm & { body:not(.layout-fixed).layout#{$infix}-navbar-fixed.text-sm & {

40
dist/css/adminlte.css vendored
View File

@ -10356,14 +10356,6 @@ body,
height: calc(2.93725rem + 1px); height: calc(2.93725rem + 1px);
} }
body:not(.layout-fixed).layout-navbar-fixed .wrapper .main-sidebar {
margin-top: calc(calc(3.5rem + 1px) / -1);
}
body:not(.layout-fixed).layout-navbar-fixed .wrapper .main-sidebar .sidebar {
margin-top: calc(3.5rem + 1px);
}
body:not(.layout-fixed).layout-navbar-fixed.text-sm .wrapper .main-sidebar { body:not(.layout-fixed).layout-navbar-fixed.text-sm .wrapper .main-sidebar {
margin-top: calc(calc(2.93725rem + 1px) / -1); margin-top: calc(calc(2.93725rem + 1px) / -1);
} }
@ -10642,14 +10634,6 @@ body:not(.layout-fixed).layout-navbar-fixed.text-sm .wrapper .main-sidebar .side
margin-top: calc(2.93725rem + 1px); margin-top: calc(2.93725rem + 1px);
} }
body:not(.layout-fixed).layout-navbar-fixed .wrapper .main-sidebar {
margin-top: calc(calc(3.5rem + 1px) / -1);
}
body:not(.layout-fixed).layout-navbar-fixed .wrapper .main-sidebar .sidebar {
margin-top: calc(3.5rem + 1px);
}
body:not(.layout-fixed).layout-navbar-fixed.text-sm .wrapper .main-sidebar { body:not(.layout-fixed).layout-navbar-fixed.text-sm .wrapper .main-sidebar {
margin-top: calc(calc(2.93725rem + 1px) / -1); margin-top: calc(calc(2.93725rem + 1px) / -1);
} }
@ -10789,12 +10773,6 @@ body:not(.layout-fixed).layout-navbar-fixed.text-sm .wrapper .main-sidebar .side
.layout-sm-navbar-fixed.text-sm .wrapper .content-wrapper { .layout-sm-navbar-fixed.text-sm .wrapper .content-wrapper {
margin-top: calc(2.93725rem + 1px); margin-top: calc(2.93725rem + 1px);
} }
body:not(.layout-fixed).layout-sm-navbar-fixed .wrapper .main-sidebar {
margin-top: calc(calc(3.5rem + 1px) / -1);
}
body:not(.layout-fixed).layout-sm-navbar-fixed .wrapper .main-sidebar .sidebar {
margin-top: calc(3.5rem + 1px);
}
body:not(.layout-fixed).layout-sm-navbar-fixed.text-sm .wrapper .main-sidebar { body:not(.layout-fixed).layout-sm-navbar-fixed.text-sm .wrapper .main-sidebar {
margin-top: calc(calc(2.93725rem + 1px) / -1); margin-top: calc(calc(2.93725rem + 1px) / -1);
} }
@ -10930,12 +10908,6 @@ body:not(.layout-fixed).layout-navbar-fixed.text-sm .wrapper .main-sidebar .side
.layout-md-navbar-fixed.text-sm .wrapper .content-wrapper { .layout-md-navbar-fixed.text-sm .wrapper .content-wrapper {
margin-top: calc(2.93725rem + 1px); margin-top: calc(2.93725rem + 1px);
} }
body:not(.layout-fixed).layout-md-navbar-fixed .wrapper .main-sidebar {
margin-top: calc(calc(3.5rem + 1px) / -1);
}
body:not(.layout-fixed).layout-md-navbar-fixed .wrapper .main-sidebar .sidebar {
margin-top: calc(3.5rem + 1px);
}
body:not(.layout-fixed).layout-md-navbar-fixed.text-sm .wrapper .main-sidebar { body:not(.layout-fixed).layout-md-navbar-fixed.text-sm .wrapper .main-sidebar {
margin-top: calc(calc(2.93725rem + 1px) / -1); margin-top: calc(calc(2.93725rem + 1px) / -1);
} }
@ -11071,12 +11043,6 @@ body:not(.layout-fixed).layout-navbar-fixed.text-sm .wrapper .main-sidebar .side
.layout-lg-navbar-fixed.text-sm .wrapper .content-wrapper { .layout-lg-navbar-fixed.text-sm .wrapper .content-wrapper {
margin-top: calc(2.93725rem + 1px); margin-top: calc(2.93725rem + 1px);
} }
body:not(.layout-fixed).layout-lg-navbar-fixed .wrapper .main-sidebar {
margin-top: calc(calc(3.5rem + 1px) / -1);
}
body:not(.layout-fixed).layout-lg-navbar-fixed .wrapper .main-sidebar .sidebar {
margin-top: calc(3.5rem + 1px);
}
body:not(.layout-fixed).layout-lg-navbar-fixed.text-sm .wrapper .main-sidebar { body:not(.layout-fixed).layout-lg-navbar-fixed.text-sm .wrapper .main-sidebar {
margin-top: calc(calc(2.93725rem + 1px) / -1); margin-top: calc(calc(2.93725rem + 1px) / -1);
} }
@ -11212,12 +11178,6 @@ body:not(.layout-fixed).layout-navbar-fixed.text-sm .wrapper .main-sidebar .side
.layout-xl-navbar-fixed.text-sm .wrapper .content-wrapper { .layout-xl-navbar-fixed.text-sm .wrapper .content-wrapper {
margin-top: calc(2.93725rem + 1px); margin-top: calc(2.93725rem + 1px);
} }
body:not(.layout-fixed).layout-xl-navbar-fixed .wrapper .main-sidebar {
margin-top: calc(calc(3.5rem + 1px) / -1);
}
body:not(.layout-fixed).layout-xl-navbar-fixed .wrapper .main-sidebar .sidebar {
margin-top: calc(3.5rem + 1px);
}
body:not(.layout-fixed).layout-xl-navbar-fixed.text-sm .wrapper .main-sidebar { body:not(.layout-fixed).layout-xl-navbar-fixed.text-sm .wrapper .main-sidebar {
margin-top: calc(calc(2.93725rem + 1px) / -1); margin-top: calc(calc(2.93725rem + 1px) / -1);
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

8
dist/js/adminlte.js vendored
View File

@ -379,6 +379,10 @@
} else { } else {
$(Selector.CONTENT).css('min-height', max + offset - heights.header); $(Selector.CONTENT).css('min-height', max + offset - heights.header);
} }
if (this._isFooterFixed()) {
$(Selector.CONTENT).css('min-height', parseFloat($(Selector.CONTENT).css('min-height')) + heights.footer);
}
} }
if ($('body').hasClass(ClassName.LAYOUT_FIXED)) { if ($('body').hasClass(ClassName.LAYOUT_FIXED)) {
@ -450,6 +454,10 @@
} }
}); });
return max; return max;
};
_proto._isFooterFixed = function _isFooterFixed() {
return $('.main-footer').css('position') === 'fixed';
} // Static } // Static
; ;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long