When adding multiple files, if there is only one reply and no file has been selected, set the first file to it instead of creating a new reply.

This commit is contained in:
Nicolas Stepien 2012-01-10 16:49:39 +01:00
parent 84057f65c1
commit 4f2c1eb775
2 changed files with 10 additions and 2 deletions

View File

@ -1300,7 +1300,11 @@
qr.error("" + file.name + ": Unsupported file type.");
break;
}
new qr.reply(file);
if (qr.replies.length === 1 && !qr.replies[0].file) {
qr.replies[0].file = file;
} else {
new qr.reply(file);
}
}
return $.addClass(qr.el, 'dump');
},

View File

@ -961,7 +961,11 @@ qr =
else if -1 is qr.mimeTypes.indexOf file.type
qr.error "#{file.name}: Unsupported file type."
break
new qr.reply file
if qr.replies.length is 1 and not qr.replies[0].file
# set initial reply's file
qr.replies[0].file = file
else
new qr.reply file
$.addClass qr.el, 'dump'
replies: []