diff options
| author | Christophe Simonis <chs@odoo.com> | 2014-10-01 19:18:14 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2014-10-01 19:18:14 +0200 |
| commit | 709c9868de7c4ac4985ed4e0055ae3e3e49742ad (patch) | |
| tree | e90227a947bddf47b3043fcbe8b99529a22aa7dd /addons/website_mail/static/src | |
| parent | 85f26244a71a0b9a7faa283d6d24fdde6bae899a (diff) | |
| parent | e8831932464814ed5f9e3a0af33f98891a466417 (diff) | |
[MERGE] forward port of branch 8.0 up to e883193
Diffstat (limited to 'addons/website_mail/static/src')
| -rw-r--r-- | addons/website_mail/static/src/js/website_email_designer.js | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/addons/website_mail/static/src/js/website_email_designer.js b/addons/website_mail/static/src/js/website_email_designer.js index 264fe33288e..9f0692b17ce 100644 --- a/addons/website_mail/static/src/js/website_email_designer.js +++ b/addons/website_mail/static/src/js/website_email_designer.js @@ -1,25 +1,26 @@ -$(function () { +(function () { 'use strict'; - if ($("#email_designer").length) { - openerp.website.snippet.BuildingBlock.include({ + var website = openerp.website; + + website.if_dom_contains('#email_designer', function () { + website.snippet.BuildingBlock.include({ _get_snippet_url: function () { return '/website_mail/snippets'; } }); - // Copy the template to the body of the email - $(document).ready(function () { - $('.js_template_set').click(function(ev) { - $('#email_designer').show(); - $('#email_template').hide(); - $(".js_content", $(this).parent()).children().clone().appendTo('#email_body'); - $(".js_content", $(this).parent()).children().clone().appendTo('#email_body_html'); - $('#email_body').addClass('oe_dirty'); - $('#email_body_html').addClass('oe_dirty'); + $('.js_template_set').click(function(ev) { + // Copy the template to the body of the email + $('#email_designer').show(); + $('#email_template').hide(); + $(".js_content", $(this).parent()).children().clone().appendTo('#email_body'); + $(".js_content", $(this).parent()).children().clone().appendTo('#email_body_html'); + $('#email_body').addClass('oe_dirty'); + $('#email_body_html').addClass('oe_dirty'); - openerp.website.editor_bar.edit(); - event.preventDefault(); - }); + openerp.website.editor_bar.edit(); + event.preventDefault(); }); - } -}); + }); + +})(); |
