Commit 64029976 authored by Boris Kocherov's avatar Boris Kocherov Committed by Vincent Bechu

[erp5_only_office] allow use object as jio_putAttachment argument

parent 0e8af437
......@@ -109,12 +109,19 @@ DocsAPI.DocEditor.version = function () {
zip = g.props.value_zip_storage,
queue,
content_type,
start = data.slice(0, 5);
start;
if (!docId) {
docId = '/media/';
}
if (typeof data === 'string' && start === "data:") {
data = dataURLtoBlob(data);
if (typeof data === 'string') {
start = data.slice(0, 5);
if (start === "data:") {
data = dataURLtoBlob(data);
}
}
if (typeof data === 'object' &&
!(data instanceof Blob)) {
data = new Blob([JSON.stringify(data, undefined, 2)]);
}
if (atId) {
queue = zip.putAttachment(docId, atId, data)
......
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