Commit 49d3e0fb authored by Boris Kocherov's avatar Boris Kocherov

[erp5_only_office] allow use object as jio_putAttachment argument

parent 6cf76ee6
......@@ -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