Skip to content
Snippets Groups Projects
Commit 3d62ed0a authored by Christophe Matthieu's avatar Christophe Matthieu
Browse files

Merge pull request #1649 from odoo-dev/8.0-fix-website_quote-scrollspy-chm

[FIX] website_quote: Must remove id created by the javascript of scroll spy.
parents 32a2cd01 009cc527
Branches
Tags
No related merge requests found
......@@ -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 = $("<li>").html('<a href="#'+id+'">'+$(this).text()+'</a>').appendTo(ul);
sub_ul = null;
break;
case "h2":
id = _.uniqueId('quote_')
id = _.uniqueId('quote_');
if (sub_li) {
if (!sub_ul) {
sub_ul = $("<ul class='nav'>").appendTo(sub_li);
}
$(this.parentNode).attr('id',id)
$(this.parentNode).attr('id',id);
$("<li>").html('<a href="#'+id+'">'+$(this).text()+'</a>').appendTo(sub_ul);
}
break;
......
......@@ -167,7 +167,7 @@
<link rel='stylesheet' href='/website_quote/static/src/css/website_quotation.css'/>
<t t-raw="head or ''"/>
</t>
<body data-spy="scroll" data-target=".navspy">
<body data-spy="scroll" data-target=".navspy" data-offset="50">
<div class="container">
<div class="row mt16">
<div class="col-md-3">
......@@ -462,7 +462,7 @@
<link rel='stylesheet' href='/website_quote/static/src/css/website_quotation.css'/>
<t t-raw="head or ''"/>
</t>
<body data-spy="scroll" data-target=".navspy">
<body data-spy="scroll" data-target=".navspy" data-offset="50">
<div class="container">
<div class="row mt16">
<div class="col-md-3">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment