summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJairo Llopis <yajo.sk8@gmail.com>2017-02-24 11:19:24 +0100
committerNicolas Lempereur <nle@odoo.com>2017-03-21 12:47:09 +0100
commitf1bf4578036e1a7261fa7d459d912cb6d8191a92 (patch)
tree3aca9c13a788e36894f08c64bcf9e27ceae0cbd9
parent89581abf145fa593439aacb67f5fa77c334fe619 (diff)
[FIX] mass_mailing: do not remove image with link
If you followed these steps, Chrome deleted the link and image: 1. Create a new mass mailing, fill the subject. 2. Drag & drop any snippet with pictograms. 3. Change a pictogram for an image. 4. Add a link to the image. 5. Save the record. This happen in chrome if the image was for example floating in the link, so this change check if an element is a contained element is visible before removing it. This issue doesn't happen with [jQuery 3][1] and may be linked to [this][2]. [1]: http://api.jquery.com/visible-selector/ [2]: http://stackoverflow.com/a/8337382/1468388 closes #15623 opw-710237 note: this is only needed in 9.0 and saas-11 because this features doesn't seem present in version 10.0
-rw-r--r--addons/mass_mailing/static/src/js/mass_mailing_editor.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/mass_mailing/static/src/js/mass_mailing_editor.js b/addons/mass_mailing/static/src/js/mass_mailing_editor.js
index 6adc552365a..651e0c979e4 100644
--- a/addons/mass_mailing/static/src/js/mass_mailing_editor.js
+++ b/addons/mass_mailing/static/src/js/mass_mailing_editor.js
@@ -228,7 +228,8 @@ snippets_editor.Class.include({
var theme = ($("#o_left_bar .o_panel_body > div:not(.hidden)").attr("class") || "").replace(/^\s*|\s*o_mail_block[^\s]+\s*|\s*oe_snippet\s*|\s*ui-draggable\s*|\s*$/g, '');
var $theme = $("#editable_area [data-snippet-theme]").removeAttr("data-snippet-theme").removeData("snippet-theme");
$editable.children().first().attr("data-snippet-theme", theme);
- $editable.find(":not(br):hidden").remove();
+ // before jQuery 3, google chrome needs the `:not(:has(:visible))` part
+ $editable.find(":not(br):hidden:not(:has(:visible))").remove();
},
});