Skip to content

Commit

Permalink
Added menu icon to minimal theme, resolves #30
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastian-lenz committed Oct 3, 2014
1 parent 6b7d3c4 commit 5a98f2e
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 17 deletions.
5 changes: 3 additions & 2 deletions bin/themes/default/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -585,9 +585,10 @@ footer .tsd-legend { display: inline-block; width: 25%; padding: 0; font-size: 1

.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; }

.tsd-anchor { position: absolute; top: -100px; }

.tsd-member { position: relative; }
.tsd-member .anchor { position: absolute; top: -100px; }
.tsd-member .anchor + h3 { margin-top: 0; margin-bottom: 0; border-bottom: none; }
.tsd-member .tsd-anchor + h3 { margin-top: 0; margin-bottom: 0; border-bottom: none; }

.tsd-navigation { padding: 0 0 0 40px; }
.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; }
Expand Down
2 changes: 1 addition & 1 deletion bin/themes/default/assets/js/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bin/themes/default/partials/member.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<section class="tsd-panel tsd-member {{cssClasses}}">
<a name="{{anchor}}" class="anchor"></a>
<a name="{{anchor}}" class="tsd-anchor"></a>
{{#if name}}
<h3>{{#each flagsArray}}<span class="tsd-flag ts-flag{{this}}">{{this}}</span> {{/each}}{{{wbr name}}}</h3>
{{/if}}
Expand Down
7 changes: 4 additions & 3 deletions bin/themes/minimal/layouts/default.hbs

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions bin/themes/minimal/partials/header.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<label class="tsd-widget" for="tsd-filter-only-exported">Only exported</label>
</div>
</div>
<a href="#typedoc-main-index" class="tsd-widget menu no-caption">Menu</a>
</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion bin/themes/minimal/partials/member.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<section class="tsd-panel tsd-member {{cssClasses}}">
<a name="{{anchor}}" class="anchor"></a>
<a name="{{anchor}}" class="tsd-anchor"></a>
{{#if name}}
<h3>{{#each flagsArray}}<span class="tsd-flag ts-flag{{this}}">{{this}}</span> {{/each}}{{{wbr name}}}</h3>
{{/if}}
Expand Down
1 change: 1 addition & 0 deletions bin/themes/minimal/templates/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
{{/if}}

{{#with model}}
<div style="position:relative;"><a name="typedoc-main-index" class="tsd-anchor"></a></div>
{{> index}}
{{> members}}
{{/with}}
10 changes: 5 additions & 5 deletions themes/default/assets/css/elements/_member.sass
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
font-size: $FONT_SIZE_MONO
font-weight: normal

.tsd-anchor
position: absolute
top: -100px

.tsd-member
position: relative

.anchor
position: absolute
top: -100px

.anchor + h3
.tsd-anchor + h3
margin-top: 0
margin-bottom: 0
border-bottom: none
6 changes: 4 additions & 2 deletions themes/default/assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,6 @@ var typedoc;
var base = window.location.href;
if (base.indexOf('#') != -1) {
base = base.substr(0, base.indexOf('#'));
console.log(base);
}

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

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

Expand Down Expand Up @@ -659,6 +658,9 @@ var typedoc;
this.$el.on(typedoc.pointerUp, function (e) {
return _this.onPointerUp(e);
});
this.$el.on('click', function (e) {
return e.preventDefault();
});
typedoc.$document.on(typedoc.pointerDown, function (e) {
return _this.onDocumentPointerDown(e);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ module typedoc
var base = window.location.href;
if (base.indexOf('#') != -1) {
base = base.substr(0, base.indexOf('#'));
console.log(base);
}

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

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

this.anchors.push({
Expand Down
1 change: 1 addition & 0 deletions themes/default/assets/js/src/typedoc/components/Toggle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ module typedoc

this.className = this.$el.attr('data-toggle');
this.$el.on(pointerUp, (e) => this.onPointerUp(e));
this.$el.on('click', (e) => e.preventDefault());
$document.on(pointerDown, (e) => this.onDocumentPointerDown(e));
$document.on(pointerUp, (e) => this.onDocumentPointerUp(e));
}
Expand Down

0 comments on commit 5a98f2e

Please sign in to comment.