From 7efbf490f62fb2f56f46461b0945d5fe335a3764 Mon Sep 17 00:00:00 2001 From: Elisabeth Dickinson Date: Mon, 31 May 2021 15:01:13 +0200 Subject: [PATCH 01/11] [FIX] odoo_theme: padding fix in sidenav --- extensions/odoo_theme/static/style.scss | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/extensions/odoo_theme/static/style.scss b/extensions/odoo_theme/static/style.scss index 944a7f28c..90d224eda 100644 --- a/extensions/odoo_theme/static/style.scss +++ b/extensions/odoo_theme/static/style.scss @@ -284,11 +284,8 @@ header.o_main_header { padding-left: 1rem; li { - &.toctree_l2 { - padding-left: .2rem; - } > a.reference { - padding-left: .8rem; + padding-left: .875rem; } a { @@ -315,7 +312,7 @@ header.o_main_header { > i[class^="i-"] { display: inline-block; - margin-right: .2rem; + margin-right: .125rem; @include o-transition(rotate, .3s); font-size: .75rem; font-weight: $fw_bold; From 675f7bc8995e9068cbf1a3f3ed31f80a0586a97a Mon Sep 17 00:00:00 2001 From: "Antoine Vandevenne (anv)" Date: Fri, 4 Jun 2021 11:37:17 +0200 Subject: [PATCH 02/11] [FIX] odoo_theme: highlight all occurrences of a same entry in the menu When a page is referenced multiple times in the global toctree, only its latest TOC entry was highlighted (and expanded if it's a TOC page). This commit allows a page to be referenced multiple times at any level of the global TOC while correctly highlighting all of its TOC entries. task-2551473 --- extensions/odoo_theme/static/js/menu.js | 28 ++++++++++++++++--------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/extensions/odoo_theme/static/js/menu.js b/extensions/odoo_theme/static/js/menu.js index 2f4d3aef7..cc56dbd72 100644 --- a/extensions/odoo_theme/static/js/menu.js +++ b/extensions/odoo_theme/static/js/menu.js @@ -21,22 +21,30 @@ * TOC entries (
  • elements) that are on the path of the displayed page receive the * `o_active_toc_entry` class, and their related (parent) TOC entry list (
      elements) receive * the `show` (Bootstrap) class. - * Also, the deepest TOC entry receives the `o_deepest_active_toc_entry` class, and its child - * TOC entry list receives the `show` class. + * Also, the deepest TOC entries of their respective branch receive the + * `o_deepest_active_toc_entry` class, and their child TOC entry lists receive the `show` class. */ const _flagActiveTocEntriesAndLists = () => { - let deepestTocEntry = undefined; + const regexLayer = /\btoctree-l(?\d+)\b/; + let lastLayer = undefined; + let lastTocEntry = undefined; + const deepestTocEntries = []; this.navigationMenu.querySelectorAll('.current').forEach(element => { if (element.tagName === 'UL') { - // Expand all related
        - element.classList.add('show'); + element.classList.add('show'); // Expand all related
          } else if (element.tagName === 'LI') { - // Highlight all
        • in the active hierarchy - element.classList.add('o_active_toc_entry'); - deepestTocEntry = element; + element.classList.add('o_active_toc_entry'); // Highlight all active
        • + let match = regexLayer.exec(element.className); + let currentLayer = parseInt(match.groups.layer, 10); + if (lastLayer && currentLayer <= lastLayer) { // We just moved to another branch + deepestTocEntries.push(lastTocEntry); + } + lastLayer = currentLayer; + lastTocEntry = element; } }) - if (deepestTocEntry) { + deepestTocEntries.push(lastTocEntry); // The last TOC entry is the deepest of its branch + deepestTocEntries.forEach(deepestTocEntry => { const childTocEntryList = deepestTocEntry.querySelector('ul'); if (childTocEntryList) { childTocEntryList.classList.add('show'); @@ -44,7 +52,7 @@ deepestTocEntry = deepestTocEntry.parentElement.parentElement; } deepestTocEntry.classList.add('o_deepest_active_toc_entry'); - } + }); }; document.addEventListener('scroll', () => { From 4c6947da4fd324079fbb9fbda42e00f5dcc95426 Mon Sep 17 00:00:00 2001 From: "Antoine Vandevenne (anv)" Date: Fri, 4 Jun 2021 13:49:20 +0200 Subject: [PATCH 03/11] [IMP] Makefile: update build instructions following merge of 46c21826 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6cf6b2267..7b7a6ea87 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ # Makefile for Sphinx documentation -# Pass WORKERS=auto for parallel build +# Pass WORKERS=1 for single-worker build ifndef WORKERS WORKERS = auto endif From 2591ddc6d249b57e594d9d8a2e6b299d070ee867 Mon Sep 17 00:00:00 2001 From: "Antoine Vandevenne (anv)" Date: Fri, 4 Jun 2021 16:24:58 +0200 Subject: [PATCH 04/11] [FIX] odoo_theme: fix crash on menu loading introduced with 675f7bc8 --- extensions/odoo_theme/static/js/menu.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/odoo_theme/static/js/menu.js b/extensions/odoo_theme/static/js/menu.js index cc56dbd72..3bd428037 100644 --- a/extensions/odoo_theme/static/js/menu.js +++ b/extensions/odoo_theme/static/js/menu.js @@ -43,7 +43,9 @@ lastTocEntry = element; } }) - deepestTocEntries.push(lastTocEntry); // The last TOC entry is the deepest of its branch + if (lastTocEntry) { + deepestTocEntries.push(lastTocEntry); // The last TOC entry is the deepest of its branch + } deepestTocEntries.forEach(deepestTocEntry => { const childTocEntryList = deepestTocEntry.querySelector('ul'); if (childTocEntryList) { From 49baf6b4d7cbdd27286fe9124b1b916cf5c8c505 Mon Sep 17 00:00:00 2001 From: Elisabeth Dickinson Date: Fri, 4 Jun 2021 17:27:11 +0200 Subject: [PATCH 05/11] [IMP] odoo_theme: fix layout on esoteric screens --- extensions/odoo_theme/layout.html | 2 +- .../odoo_theme/static/scss/_variables.scss | 10 +- extensions/odoo_theme/static/style.scss | 182 +++++++++--------- 3 files changed, 105 insertions(+), 89 deletions(-) diff --git a/extensions/odoo_theme/layout.html b/extensions/odoo_theme/layout.html index c0ccb1a51..b231697ad 100644 --- a/extensions/odoo_theme/layout.html +++ b/extensions/odoo_theme/layout.html @@ -64,7 +64,7 @@