[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.
This commit is contained in:
jpr-odoo
2017-02-10 15:21:24 +01:00
committed by Yannick Tivisse
parent d1a8d54aca
commit b229e9cb8c
+1 -2
View File
@@ -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');
}