summaryrefslogtreecommitdiff
path: root/addons/website/static/src
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2015-05-15 11:11:22 +0200
committerNicolas Lempereur <nle@odoo.com>2015-05-15 17:00:26 +0200
commit02fb59fffa01440dae803998b8e4ef2373de53a3 (patch)
tree957cef65820db016fde7e9ac2dc7262232aed40f /addons/website/static/src
parentcab5e3668f4013090f39617f64de7a82473eaec3 (diff)
[FIX] website: widget share doesn't always work
Depending on the area (in this case a html field), the editor can escape the url which wasn't taken into account by this widget. closes #6726 opw-639852
Diffstat (limited to 'addons/website/static/src')
-rw-r--r--addons/website/static/src/js/website.snippets.animation.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/website/static/src/js/website.snippets.animation.js b/addons/website/static/src/js/website.snippets.animation.js
index c72e2c3b84e..f68097c3f69 100644
--- a/addons/website/static/src/js/website.snippets.animation.js
+++ b/addons/website/static/src/js/website.snippets.animation.js
@@ -137,7 +137,8 @@
var title = encodeURIComponent($("title").text());
this.$target.find("a").each(function () {
var $a = $(this);
- $a.attr("href", $(this).attr("href").replace("{url}", url).replace("{title}", title));
+ var url_regex = /\{url\}|%7Burl%7D/, title_regex = /\{title\}|%7Btitle%7D/;
+ $a.attr("href", $(this).attr("href").replace(url_regex, url).replace(title_regex, title));
if ($a.attr("target") && $a.attr("target").match(/_blank/i)) {
$a.click(function () {
window.open(this.href,'','menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=550,width=600');