diff options
| author | jpr-odoo <jpr@openerp.com> | 2017-02-10 15:12:53 +0100 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2017-02-10 15:21:24 +0100 |
| commit | b229e9cb8c1fdc83a1aa5abd51141e32aea59bcd (patch) | |
| tree | 5924cdc892eb9240927ab4dc87c7c1e7bbb75cdf /addons | |
| parent | d1a8d54aca2e386d804162d1dcfe2c213ae339ec (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.js | 3 |
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'); } |
