From e8f860d25c328d90282ab38cf50896d95bf43f61 Mon Sep 17 00:00:00 2001 From: Nana Sakisaka Date: Fri, 10 Nov 2017 02:56:20 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=AA=E3=83=95=E3=82=A1=E3=83=AC=E3=83=B3?= =?UTF-8?q?=E3=82=B9=E9=A1=9E=E3=82=92=E5=B0=8A=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refs cpprefjp/site#476 --- css/kunai/site/sidebar.css | 17 ++++++++++++++++- js/kunai/ui/treeview.js | 13 +++++++++---- kunai_configs/cpprefjp | 2 +- 3 files changed, 26 insertions(+), 6 deletions(-) diff --git a/css/kunai/site/sidebar.css b/css/kunai/site/sidebar.css index 97d128e..96ea0ac 100644 --- a/css/kunai/site/sidebar.css +++ b/css/kunai/site/sidebar.css @@ -650,10 +650,25 @@ main[role="main"] .kunai-sidebar.force-legacy { } &[data-top-id="reference"] { - .kunai-branch { + display: flex; + flex-direction: column; + margin-bottom: 2em; + + border-bottom: 3px dashed rgba(120, 120, 220, 0.6); + + > .kunai-branch { > ul.branch { margin-bottom: .5em; } + + &[data-branch-for="headers"] { + order: 3; + margin-bottom: 2em; + max-height: 70vh; + } + &[data-branch-for="articles"] { + order: 4; + } } > ul.articles { diff --git a/js/kunai/ui/treeview.js b/js/kunai/ui/treeview.js index 3e811fd..f69dcb0 100644 --- a/js/kunai/ui/treeview.js +++ b/js/kunai/ui/treeview.js @@ -132,8 +132,12 @@ class DOM { $(e.target).closest('li').toggleClass('expanded') } - async kunaiBranch(me, scrollHandler) { - let elem = $('
', {class: 'kunai-branch', 'data-branch-id': this.lastBranchID++}).append(me.addClass('branch')) + async kunaiBranch(me, branchFor, scrollHandler) { + let elem = $('
', { + class: 'kunai-branch', + 'data-branch-id': this.lastBranchID++, + 'data-branch-for': branchFor, + }).append(me.addClass('branch')) if (scrollHandler) { elem.prepend($('
', {class: 'preview'})) @@ -215,7 +219,7 @@ class DOM { self.append(await Promise.all(l.articles.map(async (ar) => { return await this.makeArticle(ar) }))) - ret.append(await this.kunaiBranch(self)) + ret.append(await this.kunaiBranch(self, 'articles')) } return ret @@ -324,7 +328,7 @@ class Treeview { return await this.dom.makeArticle(ar) }))) - e.append(await this.dom.kunaiBranch(self)) + e.append(await this.dom.kunaiBranch(self, 'articles')) } if (top.headers && top.headers.length) { @@ -334,6 +338,7 @@ class Treeview { e.append(await this.dom.kunaiBranch( self, + 'headers', top.category.index === this.kc.categories().get('reference').index ? ::this.dom.handleScroll : null )) diff --git a/kunai_configs/cpprefjp b/kunai_configs/cpprefjp index 51c3ba9..79abb5b 160000 --- a/kunai_configs/cpprefjp +++ b/kunai_configs/cpprefjp @@ -1 +1 @@ -Subproject commit 51c3ba9d27f7e0a64ea5825e7fb47cedab9997ac +Subproject commit 79abb5b12d66fbdf26cd1d4fecada2113469075d