This repository has been archived on 2022-01-02. You can view files and clone it, but cannot push or open issues or pull requests.
AriaNg/app/scripts/core/__fix.js
2016-05-16 00:33:34 +08:00

37 lines
1.3 KiB
JavaScript

(function () {
'use strict';
//copy from AdminLTE app.js
var fixContentWrapperHeight = function () {
var neg = $('.main-header').outerHeight() + $('.main-footer').outerHeight();
var window_height = $(window).height();
var sidebar_height = $(".sidebar").height();
if ($("body").hasClass("fixed")) {
$(".content-wrapper, .right-side").css('height', window_height - $('.main-footer').outerHeight());
} else {
var postSetWidth;
if (window_height >= sidebar_height) {
$(".content-wrapper, .right-side").css('height', window_height - neg);
postSetWidth = window_height - neg;
} else {
$(".content-wrapper, .right-side").css('height', sidebar_height);
postSetWidth = sidebar_height;
}
//Fix for the control sidebar height
var controlSidebar = $($.AdminLTE.options.controlSidebarOptions.selector);
if (typeof controlSidebar !== "undefined") {
if (controlSidebar.height() > postSetWidth)
$(".content-wrapper, .right-side").css('height', controlSidebar.height());
}
}
};
$(window, ".wrapper").resize(function () {
fixContentWrapperHeight();
});
fixContentWrapperHeight();
})();