Fix layout height computation

pull/1707/head
Abdullah Almsaeed 8 years ago
parent 945211f777
commit 71c560ec27

@ -64,10 +64,10 @@ var Layout = function ($) {
_createClass(Layout, [{
key: 'fixLayoutHeight',
value: function fixLayoutHeight() {
var heights = [$(window).height(), $(Selector.HEADER).outerHeight(), $(Selector.FOOTER).outerHeight()];
var heights = [$(window).height(), $(Selector.HEADER).outerHeight(), $(Selector.FOOTER).outerHeight(), $(Selector.SIDEBAR).height()],
max = this._max(heights);
$(Selector.CONTENT).css('min-height', heights[0] - (heights[1] + heights[2]));
console.log(heights[0] - (heights[1] + heights[2]));
$(Selector.CONTENT).css('min-height', max - (heights[1] + heights[2]));
}
// Private
@ -80,7 +80,7 @@ var Layout = function ($) {
$('body').removeClass(ClassName.HOLD);
this.fixLayoutHeight();
$(Selector.SIDEBAR).on('collapsed.lte.treeview expanded.lte.treeview', function () {
$(Selector.SIDEBAR).on('collapsed.lte.treeview expanded.lte.treeview collapsed.lte.pushmenu expanded.lte.pushmenu', function () {
_this.fixLayoutHeight();
});
$(window).resize(function () {

File diff suppressed because one or more lines are too long

@ -58,11 +58,12 @@ const Layout = (($) => {
let heights = [
$(window).height(),
$(Selector.HEADER).outerHeight(),
$(Selector.FOOTER).outerHeight()
]
$(Selector.FOOTER).outerHeight(),
$(Selector.SIDEBAR).height()
],
max = this._max(heights)
$(Selector.CONTENT).css('min-height', heights[0] - (heights[1] + heights[2]))
console.log(heights[0] - (heights[1] + heights[2]))
$(Selector.CONTENT).css('min-height', max - (heights[1] + heights[2]))
}
// Private
@ -71,7 +72,7 @@ const Layout = (($) => {
$('body').removeClass(ClassName.HOLD)
this.fixLayoutHeight()
$(Selector.SIDEBAR).on('collapsed.lte.treeview expanded.lte.treeview', () => {
$(Selector.SIDEBAR).on('collapsed.lte.treeview expanded.lte.treeview collapsed.lte.pushmenu expanded.lte.pushmenu', () => {
this.fixLayoutHeight()
})
$(window).resize(() => {

Loading…
Cancel
Save