From aca0231473a92a366d315b98fb5947790a631a02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Sun, 14 May 2023 15:41:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20`layer.min(index)`=20?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=B8=8E=E6=9C=80=E5=B0=8F=E5=8C=96=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E4=BA=8B=E4=BB=B6=E6=95=88=E6=9E=9C=E4=B8=8D=E4=B8=80?= =?UTF-8?q?=E8=87=B4=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/layer.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/layer.js b/src/modules/layer.js index 5c93b853..6cdddc40 100644 --- a/src/modules/layer.js +++ b/src/modules/layer.js @@ -1025,8 +1025,6 @@ layer.style = function(index, options, limit){ // 最小化 layer.min = function(index, options){ - options = options || {}; - var layero = $('#'+ doms[0] + index); var maxminStatus = layero.data('maxminStatus'); @@ -1034,8 +1032,10 @@ layer.min = function(index, options){ if(maxminStatus === 'max') layer.restore(index); // 若当前为最大化,则先还原后再最小化 layero.data('maxminStatus', 'min'); + options = options || layero.data('config') || {}; var shadeo = $('#'+ doms.SHADE + index); + var elemMin = layero.find('.layui-layer-min'); var titHeight = layero.find(doms[1]).outerHeight() || 0; var minLeft = layero.attr('minLeft'); // 最小化时的横坐标 var hasMinLeft = typeof minLeft === 'string'; // 是否已经赋值过最小化坐标 @@ -1077,7 +1077,7 @@ layer.min = function(index, options){ layero.attr('position', position); layer.style(index, settings, true); - layero.find('.layui-layer-min').hide(); + elemMin.hide(); layero.attr('type') === 'page' && layero.find(doms[4]).hide(); ready.rescollbar(index);