From e9f1ee4d4a49c383040007ce42e8a6bc2bed9c41 Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 30 Sep 2015 12:35:34 +0200 Subject: [FIX] website: edit mailto link In function bind_data of website.editor.js, either href is a mailto link or an url link but not both. The function convert_links must not convert mailto links. opw:650443 --- addons/website/static/src/js/website.editor.js | 37 +++++++++++--------------- 1 file changed, 15 insertions(+), 22 deletions(-) (limited to 'addons/website/static/src/js/website.editor.js') diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js index e89266d6cf3..409ec0b3850 100644 --- a/addons/website/static/src/js/website.editor.js +++ b/addons/website/static/src/js/website.editor.js @@ -1657,29 +1657,22 @@ define(['summernote/summernote'], function () { }); } - var match, $control; - if (href && (match = /mailto:(.+)/.exec(href))) { - this.$('input.email-address').val(match[1]).change(); - } - if (href && !$control) { - this.page_exists(href).then(function (exist) { - if (exist) { - self.$('#link-page').select2('data', {'id': href, 'text': href}); - } else { - self.$('input.url').val(href).change(); - self.$('input.window-new').closest("div").show(); - } - }); - } - - this.page_exists(href).then(function (exist) { - if (exist) { - self.$('#link-page').select2('data', {'id': href, 'text': href}); - } else { - self.$('input.url').val(href).change(); - self.$('input.window-new').closest("div").show(); + var match; + if(href){ + if (match = /mailto:(.+)/.exec(href)) { + this.$('input.email-address').val(match[1]).change(); } - }); + else { + this.page_exists(href).then(function (exist) { + if (exist) { + self.$('#link-page').select2('data', {'id': href, 'text': href}); + } else { + self.$('input.url').val(href).change(); + self.$('input.window-new').closest("div").show(); + } + }); + } + } this.preview(); }, -- cgit v1.2.3