mirror of
https://gitee.com/layui/layui.git
synced 2026-01-28 11:11:21 +08:00
fix(layer): 改进设置页面滚动条逻辑 (#2537)
* fix(layer): 改进设置页面滚动条逻辑 * chore: 移除多余参数 --------- Co-authored-by: 贤心 <3277200+sentsim@users.noreply.github.com>
This commit is contained in:
@@ -1021,16 +1021,20 @@ ready.record = function(layero){
|
|||||||
|
|
||||||
// 设置页面滚动条
|
// 设置页面滚动条
|
||||||
ready.setScrollbar = function(index){
|
ready.setScrollbar = function(index){
|
||||||
doms.html.css('overflow', 'hidden').attr('layer-full', index);
|
doms.html.css('overflow', 'hidden');
|
||||||
};
|
};
|
||||||
|
|
||||||
// 恢复页面滚动条
|
// 恢复页面滚动条
|
||||||
ready.restScrollbar = function(index){
|
ready.restScrollbar = function(index) {
|
||||||
if(doms.html.attr('layer-full') == index){
|
// 关闭和大小化, layer-full 处理
|
||||||
doms.html[0].style[doms.html[0].style.removeProperty
|
var targetEl = $('.'+ doms[0]).filter(function(){
|
||||||
? 'removeProperty'
|
var layero = $(this);
|
||||||
: 'removeAttribute']('overflow');
|
return layero.data('config').scrollbar === false
|
||||||
doms.html.removeAttr('layer-full');
|
&& layero.data('maxminStatus') !== 'min'
|
||||||
|
&& layero.attr('times') !== String(index);
|
||||||
|
});
|
||||||
|
if(targetEl.length === 0){
|
||||||
|
doms.html.css('overflow', '');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1230,9 +1234,7 @@ layer.full = function(index){
|
|||||||
layero.data('maxminStatus', 'max');
|
layero.data('maxminStatus', 'max');
|
||||||
ready.record(layero); // 记录当前尺寸、坐标
|
ready.record(layero); // 记录当前尺寸、坐标
|
||||||
|
|
||||||
if(!doms.html.attr('layer-full')){
|
ready.setScrollbar(index);
|
||||||
ready.setScrollbar(index);
|
|
||||||
}
|
|
||||||
|
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
var isfix = layero.css('position') === 'fixed';
|
var isfix = layero.css('position') === 'fixed';
|
||||||
|
|||||||
Reference in New Issue
Block a user