mirror of https://github.com/layui/layui
fix(layer): 修复在 success 中关闭上一个弹层报错的问题 (#2548)
* fix(layer): 修复在 success 中关闭上一个弹层报错的问题 * Update src/modules/layer.js --------- Co-authored-by: morning-star <26325820+Sight-wcg@users.noreply.github.com>2.9.x-stable
parent
a86211b92f
commit
51e4af06a2
|
@ -533,15 +533,18 @@ Class.pt.creat = function(){
|
||||||
win.on('resize', ready.events.resize[that.index]);
|
win.on('resize', ready.events.resize[that.index]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 记录配置信息
|
||||||
|
that.layero.data('config', config);
|
||||||
|
|
||||||
|
// 自动关闭
|
||||||
config.time <= 0 || setTimeout(function(){
|
config.time <= 0 || setTimeout(function(){
|
||||||
layer.close(that.index);
|
layer.close(that.index);
|
||||||
}, config.time);
|
}, config.time);
|
||||||
|
|
||||||
|
|
||||||
that.move().callback();
|
that.move().callback();
|
||||||
setAnim(that.layero);
|
setAnim(that.layero);
|
||||||
|
|
||||||
// 记录配置信息
|
|
||||||
that.layero.data('config', config);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 当前实例的 resize 事件
|
// 当前实例的 resize 事件
|
||||||
|
@ -1026,10 +1029,13 @@ ready.setScrollbar = function(index){
|
||||||
|
|
||||||
// 恢复页面滚动条
|
// 恢复页面滚动条
|
||||||
ready.restScrollbar = function(index) {
|
ready.restScrollbar = function(index) {
|
||||||
|
if(!doms.html.css('overflow')) return;
|
||||||
|
|
||||||
// 关闭和大小化, layer-full 处理
|
// 关闭和大小化, layer-full 处理
|
||||||
var targetEl = $('.'+ doms[0]).filter(function(){
|
var targetEl = $('.'+ doms[0]).filter(function(){
|
||||||
var layero = $(this);
|
var layero = $(this);
|
||||||
return layero.data('config').scrollbar === false
|
var options = layero.data('config') || {};
|
||||||
|
return options.scrollbar === false
|
||||||
&& layero.data('maxminStatus') !== 'min'
|
&& layero.data('maxminStatus') !== 'min'
|
||||||
&& layero.attr('times') !== String(index);
|
&& layero.attr('times') !== String(index);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue