diff options
Diffstat (limited to 'addons/web_editor/static/src/js/widgets/widgets.js')
| -rw-r--r-- | addons/web_editor/static/src/js/widgets/widgets.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/widgets/widgets.js b/addons/web_editor/static/src/js/widgets/widgets.js index 7b02703260b..3ccba2da261 100644 --- a/addons/web_editor/static/src/js/widgets/widgets.js +++ b/addons/web_editor/static/src/js/widgets/widgets.js @@ -1164,7 +1164,7 @@ var MediaDialog = Dialog.extend({ self.$media = self.$media.parent(); self.media = self.$media[0]; tabToShow = 'video'; - } + } self.$('[href="#editor-media-' + tabToShow + '"]').tab('show'); }); @@ -1457,6 +1457,21 @@ var LinkDialog = Dialog.extend({ this.$('input[name="url"]').val(match ? match[1] : this.data.url); } + // Hide the duplicate color buttons (most of the times, primary = alpha + // and secondary = beta for example but this may depend on the theme) + this.opened().then(function () { + var colors = []; + _.each(self.$('.o_btn_preview'), function (btn) { + var $btn = $(btn); + var color = $btn.css('background-color'); + if (_.contains(colors, color)) { + $btn.remove(); + } else { + colors.push(color); + } + }); + }); + this._adaptPreview(); this.$('input:visible:first').focus(); |
