Skip to content

Commit 1772794

Browse files
committed
jsdoc: add sticky nav and header links on hover
1 parent d5acf0e commit 1772794

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

bin/jsdoc3-moogle/static/styles/jsdoc-default.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,10 @@ nav
111111
box-sizing: border-box;
112112
border-left: 1px solid #ccc;
113113
padding-left: 16px;
114+
/* Start MOOGLE Changes */
115+
position: sticky;
116+
position: -webkit-sticky;
117+
top: 10px;
114118
}
115119

116120
nav ul {
@@ -363,7 +367,8 @@ tr > th:last-child { border-right: 1px solid #ddd; }
363367
{
364368
display: none;
365369
}
366-
tr:hover .showHover
370+
tr:hover .showHover,
371+
h4:hover .showHover
367372
{
368373
display: inline-block;
369374
}

bin/jsdoc3-moogle/tmpl/method.tmpl

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,16 @@ var self = this;
88
<?js } ?>
99

1010
<?js if (data.kind !== 'namespace') { ?>
11-
<h4 class="name" id="<?js= id ?>"><?js= data.attribs + (kind === 'class' ? 'new ' : '') +
12-
name + (data.signature || '') ?></h4>
11+
<h4 class="name" id="<?js= id ?>">
12+
<?js= data.attribs + (kind === 'class' ? 'new ' : '') + name + (data.signature || '') ?>
13+
14+
<a class="showHover" href="#<?js= id ?>">
15+
<svg aria-hidden="true" class="octicon octicon-link" height="16" version="1.1" viewBox="0 0 16 16" width="16">
16+
<path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z">
17+
</path>
18+
</svg>
19+
</a>
20+
</h4>
1321
<?js } ?>
1422

1523
<?js if (data.summary) { ?>

0 commit comments

Comments
 (0)