diff --git a/addons/website_quote/static/src/js/website_quotation.js b/addons/website_quote/static/src/js/website_quotation.js index 646cbe25375..1e9203b5df6 100644 --- a/addons/website_quote/static/src/js/website_quotation.js +++ b/addons/website_quote/static/src/js/website_quotation.js @@ -65,24 +65,26 @@ $(document).ready(function () { }); // automatically generate a menu from h1 and h2 tag in content - var ul = $('[data-id="quote_sidebar"]'); + var $container = $('body[data-target=".navspy"]'); + var ul = $('[data-id="quote_sidebar"]', $container); var sub_li = null; var sub_ul = null; - $("section h1, section h2").each(function() { + $("[id^=quote_header_], [id^=quote_]", $container).attr("id", ""); + $("h1, h2", $container).each(function() { switch (this.tagName.toLowerCase()) { case "h1": - id = _.uniqueId('quote_header_') + id = _.uniqueId('quote_header_'); $(this.parentNode).attr('id',id); sub_li = $("
  • ").html(''+$(this).text()+'').appendTo(ul); sub_ul = null; break; case "h2": - id = _.uniqueId('quote_') + id = _.uniqueId('quote_'); if (sub_li) { if (!sub_ul) { sub_ul = $("