Skip to content

Commit

Permalink
fix: 修复图片 popup 报错 (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
xuexb authored Apr 19, 2018
1 parent 171d8ba commit 92530d8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mip",
"version": "1.0.81",
"version": "1.0.82",
"description": "mobile instant page",
"main": "dist/mip.js",
"dependencies": {},
Expand Down
6 changes: 2 additions & 4 deletions src/components/mip-img.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 92530d8

Please sign in to comment.