From 528276438b794cfc873f22ab5e4b4698468aa3ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=81=AB=E7=83=88=E9=B8=9F?= <250023777@qq.com> Date: Sat, 17 Jun 2023 23:33:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layui.js | 2 +- src/modules/layer.js | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/layui.js b/src/layui.js index 50c90466..45fc66b5 100644 --- a/src/layui.js +++ b/src/layui.js @@ -550,7 +550,7 @@ // 移动设备 result.android = /android/.test(agent); result.ios = result.os === 'ios'; - result.mobile = (result.android || result.ios) ? true : false; + result.mobile = (result.android || result.ios); return result; }; diff --git a/src/modules/layer.js b/src/modules/layer.js index 1acb6934..221d7723 100644 --- a/src/modules/layer.js +++ b/src/modules/layer.js @@ -74,7 +74,7 @@ var isLayui = window.layui && layui.define, $, win, ready = { //如果轮询超过指定秒数,则视为请求文件失败或 css 文件不符合规范 if(++timeout > 10 * 1000 / delay){ return window.console && console.error(app +'.css: Invalid'); - }; + } //css 加载就绪 if(parseInt(ready.getStyle(getLinkElem, 'width')) === 1989){ @@ -406,9 +406,9 @@ Class.pt.creat = function(){ } else if(options.hideOnClose){ elemShade.show(); layero.show(); - }; + } })(); - }; + } // 是否移除活动元素的焦点 if(config.removeFocus) { @@ -518,7 +518,7 @@ Class.pt.creat = function(){ that.layero.addClass(animClass).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){ $(this).removeClass(animClass); }); - }; + } // 记录配置信息 that.layero.data('config', config); @@ -571,7 +571,7 @@ Class.pt.auto = function(index){ setHeight('.'+doms[5]); } break; - }; + } return that; }; @@ -660,7 +660,7 @@ Class.pt.tips = function(){ tipsG.css({right: 12, left: 'auto'}); } else { goal.tipLeft = goal.left; - }; + } }; //辨别tips的方位 @@ -1016,11 +1016,11 @@ layer.style = function(index, options, limit){ if(!limit){ if(parseFloat(options.width) <= 260){ options.width = 260; - }; + } if(parseFloat(options.height) - titHeight - btnHeight <= 64){ options.height = 64 + titHeight + btnHeight; - }; + } } layero.css(options); btnHeight = layero.find('.'+doms[6]).outerHeight() || 0; @@ -1131,7 +1131,7 @@ layer.restore = function(index){ // 全屏(最大化) layer.full = function(index){ - var layero = $('#'+ doms[0] + index), timer; + var layero = $('#'+ doms[0] + index); var maxminStatus = layero.data('maxminStatus'); if(maxminStatus === 'max') return // 检查当前的状态是否已经是最大化 @@ -1143,8 +1143,8 @@ layer.full = function(index){ if(!doms.html.attr('layer-full')){ doms.html.css('overflow','hidden').attr('layer-full', index); } - clearTimeout(timer); - timer = setTimeout(function(){ + + setTimeout(function(){ var isfix = layero.css('position') === 'fixed'; layer.style(index, { top: isfix ? 0 : win.scrollTop(), @@ -1262,7 +1262,7 @@ layer.closeAll = function(type, callback){ if(typeof type === 'function'){ callback = type; type = null; - }; + } var domsElem = $('.'+doms[0]); $.each(domsElem, function(_index){ var othis = $(this); @@ -1455,7 +1455,7 @@ layer.photos = function(options, loop, key){ dict.imgIndex++; if(dict.imgIndex > data.length){ dict.imgIndex = 1; - if (errorMsg) {return}; + if (errorMsg) {return} } dict.tabimg(key) }; @@ -1521,7 +1521,7 @@ layer.photos = function(options, loop, key){ img.onerror = null; error(e); }; - }; + } dict.loadi = layer.load(1, { shade: 'shade' in options ? false : 0.9,