Commit 4bdf6c80 authored by Boris Kocherov's avatar Boris Kocherov

erp5_officejs: schema_editor: schema reference update if file uploaded

parent 4e1ad326
......@@ -43,10 +43,11 @@
.push(function (content) {
var list = [],
blob;
if (content.data_file_upload) {
blob = jIO.util.dataURItoBlob(content.data_file_upload.url);
content.title = content.data_file_upload.file_name;
delete content.data_file_upload;
if (content.file) {
blob = jIO.util.dataURItoBlob(content.file.url);
content.title = content.title || content.file.file_name;
content.reference = content.reference || content.file.file_name;
delete content.file;
list = [
gadget.updateDocument(content),
gadget.jio_putAttachment(gadget.state.jio_key, 'data', blob)
......@@ -124,7 +125,7 @@
"css_class": "",
"required": 0,
"editable": 1,
"key": "data_file_upload",
"key": "file",
"hidden": 0,
"accept": "application/json",
"type": "FileField"
......@@ -178,4 +179,4 @@
});
});
});
}(window, jIO, rJS, RSVP));
}(window, jIO, rJS, RSVP));
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment