Skip to content
Snippets Groups Projects
Commit 5c069053 authored by leandro's avatar leandro
Browse files

update function for a attachmentFile

parent ebb3b556
No related branches found
No related tags found
No related merge requests found
......@@ -458,10 +458,10 @@ export default {
//console.log("POST comment", data);
},
getAttachmentFileData(evt) {
const input = evt.target.value;
const period = input.lastIndexOf(".");
const fileName = input.substring(0, period);
const fileExtension = input.substring(period + 1);
const files = evt.target.files || evt.dataTransfer.files;
const period = files[0].name.lastIndexOf(".");
const fileName = files[0].name.substring(0, period)
const fileExtension = files[0].name.substring(period + 1);
const shortName = fileName.slice(0, 10) + "[...]." + fileExtension;
this.comment_form.attachment_file.value = shortName;
this.comment_form.title.value = shortName;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment