summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorjpr-odoo <jpr@openerp.com>2017-02-10 15:12:53 +0100
committerYannick Tivisse <yti@odoo.com>2017-02-10 15:21:24 +0100
commitb229e9cb8c1fdc83a1aa5abd51141e32aea59bcd (patch)
tree5924cdc892eb9240927ab4dc87c7c1e7bbb75cdf /addons
parentd1a8d54aca2e386d804162d1dcfe2c213ae339ec (diff)
[FIX] web_editor: Show only image tab in media dialog if field type is 'image'
Reproducible steps: Select an icon instead of a picture -> it breaks it up or a video, or a document. The tabs shouldn't be displayed at all.
Diffstat (limited to 'addons')
-rw-r--r--addons/web_editor/static/src/js/widgets.js3
1 files changed, 1 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/js/widgets.js b/addons/web_editor/static/src/js/widgets.js
index fcffc2f343b..cd6b5befb06 100644
--- a/addons/web_editor/static/src/js/widgets.js
+++ b/addons/web_editor/static/src/js/widgets.js
@@ -107,8 +107,7 @@ var MediaDialog = Dialog.extend({
},
start: function () {
var self = this;
-
- this.only_images = this.options.only_images || this.options.select_images || (this.media && $(this.media).parent().data("oe-field") === "image");
+ this.only_images = this.options.only_images || this.options.select_images || (this.media && ($(this.media).parent().data("oe-field") === "image" || $(this.media).parent().data("oe-type") === "image"));
if (this.only_images) {
this.$('[href="#editor-media-document"], [href="#editor-media-video"], [href="#editor-media-icon"]').addClass('hidden');
}