From 92530d8e2e3cdb7a6834cf037efadd881cd8d93d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=89=8D=E7=AB=AF=E5=B0=8F=E6=AD=A6?= Date: Thu, 19 Apr 2018 17:22:37 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9B=BE=E7=89=87=20p?= =?UTF-8?q?opup=20=E6=8A=A5=E9=94=99=20(#303)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/components/mip-img.js | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index d51e3db2..891c0ba7 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mip", - "version": "1.0.81", + "version": "1.0.82", "description": "mobile instant page", "main": "dist/mip.js", "dependencies": {}, diff --git a/src/components/mip-img.js b/src/components/mip-img.js index 3d71a254..b648ee06 100755 --- a/src/components/mip-img.js +++ b/src/components/mip-img.js @@ -77,10 +77,8 @@ define(function (require) { // 创建弹层 dom function createPopup(element, img) { var mipPopWrap = document.querySelector('.mip-img-popUp-wrapper'); - var popAttrLegal = mipPopWrap.getAttribute('data-name') === 'mip-img-popUp-name'; - var inBody = mipPopWrap.parentNode.tagName.toLowerCase() === 'body'; - - if (!!mipPopWrap && popAttrLegal && inBody) { + if (!!mipPopWrap && mipPopWrap.getAttribute('data-name') === 'mip-img-popUp-name' + && mipPopWrap.parentNode.tagName.toLowerCase() === 'body') { mipPopWrap.querySelector('img').setAttribute('src', img.src); return mipPopWrap; }