summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js
diff options
context:
space:
mode:
authorThanhDodeurOdoo <tso@odoo.com>2018-11-07 14:52:33 +0000
committerThanhDodeurOdoo <tso@odoo.com>2018-12-06 19:09:33 +0000
commit89f20d2c297d99d4eb0ded8be78fbf86b8ec45d3 (patch)
treec86e3d9085425ef7aa9ddf4dcdd453b766a0b90f /addons/mail/static/src/js
parent72905feee0b5393f8872e51b33a10e4ec7978085 (diff)
[REF] base, mail: splits the documents feature from ir attachment
Moved the field 'active', 'res_model_name' and 'thumbnail' from ir.attachment to enterprise's documents.document. Moved the pdf split feature to enterprise's Documents module. task: #1908896
Diffstat (limited to 'addons/mail/static/src/js')
-rw-r--r--addons/mail/static/src/js/document_viewer.js22
1 files changed, 2 insertions, 20 deletions
diff --git a/addons/mail/static/src/js/document_viewer.js b/addons/mail/static/src/js/document_viewer.js
index e2c03e24d6a..9affc3f41cf 100644
--- a/addons/mail/static/src/js/document_viewer.js
+++ b/addons/mail/static/src/js/document_viewer.js
@@ -13,7 +13,6 @@ var DocumentViewer = Widget.extend({
template: "DocumentViewer",
events: {
'click .o_download_btn': '_onDownload',
- 'click .o_split_btn': '_onSplitPDF',
'click .o_viewer_img': '_onImageClicked',
'click .o_viewer_video': '_onVideoClicked',
'click .move_next': '_onNext',
@@ -44,7 +43,7 @@ var DocumentViewer = Widget.extend({
init: function (parent, attachments, activeAttachmentID) {
this._super.apply(this, arguments);
this.attachment = _.filter(attachments, function (attachment) {
- var match = attachment.type == 'url' ? attachment.url.match("(youtu|.png|.jpg|.gif)") : attachment.mimetype.match("(image|video|application/pdf|text)");
+ var match = attachment.type === 'url' ? attachment.url.match("(youtu|.png|.jpg|.gif)") : attachment.mimetype.match("(image|video|application/pdf|text)");
if (match) {
attachment.type = match[1];
@@ -67,6 +66,7 @@ var DocumentViewer = Widget.extend({
}
});
this.activeAttachment = _.findWhere(attachments, {id: activeAttachmentID});
+ this.modelName = 'ir.attachment';
this._reset();
},
/**
@@ -329,24 +329,6 @@ var DocumentViewer = Widget.extend({
* @private
* @param {MouseEvent} e
*/
- _onSplitPDF: function (e) {
- e.stopPropagation();
- var self = this;
- var indices = $("input[name=Indices]").val();
- var remainder = $("input[type=checkbox][name=remainder]").is(":checked");
- this._rpc({
- model: 'ir.attachment',
- method: 'split_pdf',
- args: [this.activeAttachment.id, indices, remainder],
- }).always(function () {
- self.trigger_up('document_viewer_attachment_changed');
- self.destroy();
- });
- },
- /**
- * @private
- * @param {MouseEvent} e
- */
_onStartDrag: function (e) {
e.preventDefault();
this.enableDrag = true;