图片放大

courseware
caicai8 5 years ago
parent 97c08b84c0
commit 076cc1bae9

@ -16,7 +16,7 @@ function ImageLayer2(props) {
const imageSrc = event.target.src || event.target.getAttribute('src') || event.target.getAttribute('href')
// 判断imageSrc是否是图片
const fileName = event.target.innerHTML.trim()
if (isImageExtension(imageSrc.trim()) || isImageExtension(fileName) || event.target.tagName == 'IMG' || imageSrc.indexOf('base64,') != -1) {
if (isImageExtension((imageSrc && imageSrc.trim())) || isImageExtension(fileName) || event.target.tagName == 'IMG' || (imageSrc && imageSrc.indexOf('base64,')) != -1) {
// 非回复里的头像图片; 非emoticons
if (imageSrc.indexOf('/images/avatars/User') === -1 &&
imageSrc.indexOf('kindeditor/plugins/emoticons') === -1 ) {

@ -19,7 +19,7 @@ class ImageLayer extends Component {
{showImage ?
<div className="taskResultLayer" onClick={onImageLayerClose} style={{overflow: 'auto'}}>
<div className="passContent">
<div><img src={ imageSrc } className="passImg" unselectable="on"/></div>
<img src={ imageSrc } className="passImg" unselectable="on" alt=""/>
</div>
</div>
:

Loading…
Cancel
Save