Skip to content

Commit 5a98f2e

Browse files
Added menu icon to minimal theme, resolves #30
1 parent 6b7d3c4 commit 5a98f2e

File tree

11 files changed

+23
-17
lines changed

11 files changed

+23
-17
lines changed

bin/themes/default/assets/css/main.css

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -585,9 +585,10 @@ footer .tsd-legend { display: inline-block; width: 25%; padding: 0; font-size: 1
585585

586586
.tsd-flag { display: inline-block; padding: 1px 5px; border-radius: 4px; color: white; background-color: gray; text-indent: 0; font-size: 14px; font-weight: normal; }
587587

588+
.tsd-anchor { position: absolute; top: -100px; }
589+
588590
.tsd-member { position: relative; }
589-
.tsd-member .anchor { position: absolute; top: -100px; }
590-
.tsd-member .anchor + h3 { margin-top: 0; margin-bottom: 0; border-bottom: none; }
591+
.tsd-member .tsd-anchor + h3 { margin-top: 0; margin-bottom: 0; border-bottom: none; }
591592

592593
.tsd-navigation { padding: 0 0 0 40px; }
593594
.tsd-navigation a { display: block; padding-top: 2px; padding-bottom: 2px; border-left: 2px solid transparent; color: #222222; text-decoration: none; -webkit-transition: border-left-color 0.1s; transition: border-left-color 0.1s; }

bin/themes/default/assets/js/main.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/themes/default/partials/member.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<section class="tsd-panel tsd-member {{cssClasses}}">
2-
<a name="{{anchor}}" class="anchor"></a>
2+
<a name="{{anchor}}" class="tsd-anchor"></a>
33
{{#if name}}
44
<h3>{{#each flagsArray}}<span class="tsd-flag ts-flag{{this}}">{{this}}</span> {{/each}}{{{wbr name}}}</h3>
55
{{/if}}

bin/themes/minimal/layouts/default.hbs

Lines changed: 4 additions & 3 deletions
Large diffs are not rendered by default.

bin/themes/minimal/partials/header.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
2525
</div>
2626
</div>
27+
<a href="#typedoc-main-index" class="tsd-widget menu no-caption">Menu</a>
2728
</div>
2829
</div>
2930
</div>

bin/themes/minimal/partials/member.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<section class="tsd-panel tsd-member {{cssClasses}}">
2-
<a name="{{anchor}}" class="anchor"></a>
2+
<a name="{{anchor}}" class="tsd-anchor"></a>
33
{{#if name}}
44
<h3>{{#each flagsArray}}<span class="tsd-flag ts-flag{{this}}">{{this}}</span> {{/each}}{{{wbr name}}}</h3>
55
{{/if}}

bin/themes/minimal/templates/index.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
{{/if}}
1111

1212
{{#with model}}
13+
<div style="position:relative;"><a name="typedoc-main-index" class="tsd-anchor"></a></div>
1314
{{> index}}
1415
{{> members}}
1516
{{/with}}

themes/default/assets/css/elements/_member.sass

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
font-size: $FONT_SIZE_MONO
99
font-weight: normal
1010

11+
.tsd-anchor
12+
position: absolute
13+
top: -100px
14+
1115
.tsd-member
1216
position: relative
1317

14-
.anchor
15-
position: absolute
16-
top: -100px
17-
18-
.anchor + h3
18+
.tsd-anchor + h3
1919
margin-top: 0
2020
margin-bottom: 0
2121
border-bottom: none

themes/default/assets/js/main.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ var typedoc;
184184
var base = window.location.href;
185185
if (base.indexOf('#') != -1) {
186186
base = base.substr(0, base.indexOf('#'));
187-
console.log(base);
188187
}
189188

190189
this.$el.find('a').each(function (index, el) {
@@ -195,7 +194,7 @@ var typedoc;
195194
return;
196195

197196
var hash = href.substr(href.indexOf('#') + 1);
198-
var $anchor = $('a.anchor[name=' + hash + ']');
197+
var $anchor = $('a.tsd-anchor[name=' + hash + ']');
199198
if ($anchor.length == 0)
200199
return;
201200

@@ -659,6 +658,9 @@ var typedoc;
659658
this.$el.on(typedoc.pointerUp, function (e) {
660659
return _this.onPointerUp(e);
661660
});
661+
this.$el.on('click', function (e) {
662+
return e.preventDefault();
663+
});
662664
typedoc.$document.on(typedoc.pointerDown, function (e) {
663665
return _this.onDocumentPointerDown(e);
664666
});

themes/default/assets/js/src/typedoc/components/MenuHighlight.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ module typedoc
6666
var base = window.location.href;
6767
if (base.indexOf('#') != -1) {
6868
base = base.substr(0, base.indexOf('#'));
69-
console.log(base);
7069
}
7170

7271
this.$el.find('a').each((index, el:HTMLAnchorElement) => {
@@ -75,7 +74,7 @@ module typedoc
7574
if (href.substr(0, base.length) != base) return;
7675

7776
var hash = href.substr(href.indexOf('#') + 1);
78-
var $anchor = $('a.anchor[name=' + hash + ']');
77+
var $anchor = $('a.tsd-anchor[name=' + hash + ']');
7978
if ($anchor.length == 0) return;
8079

8180
this.anchors.push({

themes/default/assets/js/src/typedoc/components/Toggle.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module typedoc
1515

1616
this.className = this.$el.attr('data-toggle');
1717
this.$el.on(pointerUp, (e) => this.onPointerUp(e));
18+
this.$el.on('click', (e) => e.preventDefault());
1819
$document.on(pointerDown, (e) => this.onDocumentPointerDown(e));
1920
$document.on(pointerUp, (e) => this.onDocumentPointerUp(e));
2021
}

0 commit comments

Comments
 (0)