提交 b0882dfc 编写于 作者: C Catouse

* fix scrollInside option not work as expected.

上级 79457f05
......@@ -88,7 +88,7 @@
var bodyCss = {maxHeight: 'initial', overflow: 'visible'};
var $body = $dialog.find('.modal-body').css(bodyCss);
if (options.scrollInside) {
if (options.scrollInside && $body.length) {
var headerHeight = options.headerHeight;
if (typeof headerHeight !== 'number') {
headerHeight = $dialog.find('.modal-header').height();
......@@ -97,8 +97,8 @@
}
bodyCss.maxHeight = winHeight - headerHeight;
bodyCss.overflow = $body[0].scrollHeight > bodyCss.maxHeight ? 'auto' : 'visible';
$body.css(bodyCss);
}
$body.css(bodyCss);
var half = Math.max(0, (winHeight - $dialog.outerHeight()) / 2);
if (position === 'fit') {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册