Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
admpub committed Oct 4, 2024
1 parent 11cf1d6 commit 68daff5
Showing 1 changed file with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,7 @@
//监听粘贴板事件
var $textarea = $('#' + id);
$textarea.off('paste').on('paste', function (e) {
e.preventDefault()
e.stopPropagation()
var items = (e.clipboardData || e.originalEvent.clipboardData || window.clipboardData).items;
//判断图片类型
if (items && items.length) {
var file = null;
for (var i = 0; i < items.length; i++) {
Expand All @@ -88,10 +85,9 @@
}
}

if (!file) {
console.log("粘贴内容非图片");
return;
}
if (!file) return;
e.preventDefault()
e.stopPropagation()
upload.call(_this, file);
}
});
Expand Down

0 comments on commit 68daff5

Please sign in to comment.