Skip to content

Commit

Permalink
リファレンス類を尊重
Browse files Browse the repository at this point in the history
  • Loading branch information
saki7 committed Nov 9, 2017
1 parent 561c7f8 commit e8f860d
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
17 changes: 16 additions & 1 deletion css/kunai/site/sidebar.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
13 changes: 9 additions & 4 deletions js/kunai/ui/treeview.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,12 @@ class DOM {
$(e.target).closest('li').toggleClass('expanded')
}

async kunaiBranch(me, scrollHandler) {
let elem = $('<div>', {class: 'kunai-branch', 'data-branch-id': this.lastBranchID++}).append(me.addClass('branch'))
async kunaiBranch(me, branchFor, scrollHandler) {
let elem = $('<div>', {
class: 'kunai-branch',
'data-branch-id': this.lastBranchID++,
'data-branch-for': branchFor,
}).append(me.addClass('branch'))

if (scrollHandler) {
elem.prepend($('<div>', {class: 'preview'}))
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand All @@ -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
))
Expand Down
2 changes: 1 addition & 1 deletion kunai_configs/cpprefjp
Submodule cpprefjp updated 1 files
+4 −4 article.md

0 comments on commit e8f860d

Please sign in to comment.