Commit b4b1dca4 authored by Boris Kocherov's avatar Boris Kocherov Committed by Romain Courteaud

[erp5_only_office] allow use object as jio_putAttachment argument

parent 8e3ab186
......@@ -108,12 +108,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