THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

瀏覽代碼

attachment: Fix drag and drop bug when to edit comment

tags/v1.11.0
Suwon Chae 1 年之前
父節點
當前提交
129304337f
共有 1 個檔案被更改,包括 7 行新增4 行删除
  1. +7
    -4
      public/javascripts/common/yona.CommentAttachmentsUpdate.js

+ 7
- 4
public/javascripts/common/yona.CommentAttachmentsUpdate.js 查看文件

@@ -75,11 +75,16 @@ $(function(){
var $attachfiles = $parentForm.find(".temporaryUploadFiles");
var $textarea = $parentForm.find("textarea");

if (doneCount === 0) {

if ($attachfiles.val() === "") {
$attachfiles.val(data.id);
} else {
$attachfiles.val($attachfiles.val() + "," + data.id);
var splitted = $attachfiles.val().split(",");
if(!splitted.includes(data.id)) {
$attachfiles.val(splitted.concat(data.id).join(","));
}
}

var attachment = '<div class="attached-file attached-file-marker" data-mime="' +
data.mimeType.trim() + '" data-name="' + data.name + '" data-href="' + data.url + '">\n' +
'<strong class="name">' + data.name + '</strong>\n' +
@@ -120,8 +125,6 @@ $(function(){
var dt = e.originalEvent.dataTransfer;
var files = dt.files;

console.log(files);

$(this).css("border", rememberBorder);
$(this).parent().closest("form").find(".file-upload__input")[0].files = files;
})


Loading…
取消
儲存