summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/widgets
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2018-09-11 18:06:38 +0200
committerqsm-odoo <qsm@odoo.com>2018-09-12 10:56:46 +0200
commit39a441e9022e023d1b149fa4eec55534dbbac797 (patch)
tree3bd14333dda114a6035034e6a1f5a0ca13c9bb1c /addons/web_editor/static/src/js/widgets
parent0cbf6387309b863feb8172449d6074baa9a91aab (diff)
[FIX] web_editor: restore link dialog preview
By default, all btn colors are suggested in the link dialog (alpha, beta, gamma, delta, epsilon, link, primary, secondary, success, info, warning and danger). In lots of themes (and the default one), primary = alpha and secondary = beta, which led to having two suggestion with the same apparent color. A new system was introduced to automatically remove the duplicates... but this system also removed the button preview as it considered it to be a duplicate. This commit also adapts the preview to BS4. task-1878245
Diffstat (limited to 'addons/web_editor/static/src/js/widgets')
-rw-r--r--addons/web_editor/static/src/js/widgets/widgets.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web_editor/static/src/js/widgets/widgets.js b/addons/web_editor/static/src/js/widgets/widgets.js
index 3e924cd0a2c..02a08f711dc 100644
--- a/addons/web_editor/static/src/js/widgets/widgets.js
+++ b/addons/web_editor/static/src/js/widgets/widgets.js
@@ -1461,7 +1461,7 @@ var LinkDialog = Dialog.extend({
// 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) {
+ _.each(self.$('.o_btn_preview.o_link_dialog_color_item'), function (btn) {
var $btn = $(btn);
var color = $btn.css('background-color');
if (_.contains(colors, color)) {
@@ -1521,7 +1521,7 @@ var LinkDialog = Dialog.extend({
$preview.attr({
target: data.isNewWindow ? '_blank' : '',
href: data.url && data.url.length ? data.url : '#',
- class: data.classes.replace(/pull-\w+/, '') + ' o_btn_preview',
+ class: data.classes.replace(/float-\w+/, '') + ' o_btn_preview',
}).html((data.label && data.label.length) ? data.label : data.url);
},
/**