mirror of https://github.com/layui/layui
fix(layer): 改进 maxWidth 和 maxHeight 的处理 (#2270)
parent
18e01433a3
commit
0a532f313a
|
@ -153,7 +153,7 @@ layer.open({
|
||||||
<td>maxWidth</td>
|
<td>maxWidth</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
弹层的最大宽度。当 `area` 属性值为默认的 `auto'` 时有效。
|
弹层的最大宽度。当 `area` 属性设置宽度自适应时有效。
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td>number</td>
|
<td>number</td>
|
||||||
|
@ -167,7 +167,7 @@ layer.open({
|
||||||
<td>maxHeight</td>
|
<td>maxHeight</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
||||||
弹层的最大高度。当 `area` 属设置高度自适应时有效。
|
弹层的最大高度。当 `area` 属性设置高度自适应时有效。
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td>number</td>
|
<td>number</td>
|
||||||
|
|
|
@ -558,7 +558,7 @@ Class.pt.resize = function(){
|
||||||
Class.pt.auto = function(index){
|
Class.pt.auto = function(index){
|
||||||
var that = this, config = that.config, layero = $('#'+ doms[0] + index);
|
var that = this, config = that.config, layero = $('#'+ doms[0] + index);
|
||||||
|
|
||||||
if(config.area[0] === '' && config.maxWidth > 0){
|
if((config.area[0] === '' || config.area[0] === 'auto') && config.maxWidth > 0){
|
||||||
// 适配 ie7
|
// 适配 ie7
|
||||||
if(layer.ie && layer.ie < 8 && config.btn){
|
if(layer.ie && layer.ie < 8 && config.btn){
|
||||||
layero.width(layero.innerWidth());
|
layero.width(layero.innerWidth());
|
||||||
|
@ -579,7 +579,7 @@ Class.pt.auto = function(index){
|
||||||
setHeight('iframe');
|
setHeight('iframe');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if(config.area[1] === ''){
|
if(config.area[1] === '' || config.area[1] === 'auto'){
|
||||||
if(config.maxHeight > 0 && layero.outerHeight() > config.maxHeight){
|
if(config.maxHeight > 0 && layero.outerHeight() > config.maxHeight){
|
||||||
area[1] = config.maxHeight;
|
area[1] = config.maxHeight;
|
||||||
setHeight('.'+doms[5]);
|
setHeight('.'+doms[5]);
|
||||||
|
|
Loading…
Reference in New Issue