From 4734cbab4d72afcc5b92b2e1714bc372800aae41 Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Thu, 18 Dec 2014 17:20:46 +0100 Subject: [IMP] website.snippet: snippets can be splitted into separate template and be called into the lits of the snippet --- .../static/src/js/website.snippets.editor.js | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'addons/website/static/src/js') diff --git a/addons/website/static/src/js/website.snippets.editor.js b/addons/website/static/src/js/website.snippets.editor.js index 90fbf3a4ce3..adfbcbd1b46 100644 --- a/addons/website/static/src/js/website.snippets.editor.js +++ b/addons/website/static/src/js/website.snippets.editor.js @@ -182,6 +182,12 @@ .then(function (html) { var $html = $(html); + // t-snippet + $html.find('> .tab-content > div > [data-oe-type="snippet"]').each(function () { + var $div = $('
').insertAfter(this).append(this).attr('name', $(this).data('oe-name')); + }); + // end + var selector = []; var $styles = $html.find("[data-js], [data-selector]"); $styles.each(function () { @@ -214,10 +220,28 @@ '
'); $div.find('span').text($(this).attr("name")); $(this).prepend($div); + + // from t-snippet + var thumbnail = $("[data-oe-thumbnail]", this).data("oe-thumbnail"); + if (thumbnail) { + $div.find('.oe_snippet_thumbnail_img').css('background-image', 'url(' + thumbnail + ')'); + } + // end } $("> *:not(.oe_snippet_thumbnail)", this).addClass('oe_snippet_body'); }); + // clean t-oe + $html.find('[data-oe-model]').each(function () { + for (var k=0; k