Skip to content

Fix many mobile issues with dartdoc #1873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Dec 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions lib/resources/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,4 +197,5 @@ document.addEventListener("DOMContentLoaded", function() {
initSideNav();
initSearch("search-box");
initSearch("search-body");
initSearch("search-sidebar");
});
22 changes: 19 additions & 3 deletions lib/resources/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ header form {
padding-right: 30px;
}

header#header-search-sidebar {
height: 50px;
margin-bottom: 25px;
}

footer {
flex: 0 0 16px;
text-align: center;
Expand Down Expand Up @@ -110,9 +115,15 @@ nav.navbar {
border: 0;
}

@media (max-width: 767px) {
@media (max-width: 768px) {
.hidden-xs {
display: none!important;
display: none !important;
}
}

@media (min-width: 769px) {
.hidden-l {
display: none !important;
}
}

Expand Down Expand Up @@ -740,6 +751,11 @@ button {
padding: 10px;
}

ol#sidebar-nav {
font-size: 18px;
white-space: pre-line;
}

.sidebar-offcanvas-left.active {
left: 0; /* this animates our drawer into the page */
}
Expand Down Expand Up @@ -777,7 +793,7 @@ button {
border: 0;
}

@media screen and (max-width: 500px) {
@media screen and (max-width: 768px) {
form.search {
display: none;
}
Expand Down
1 change: 1 addition & 0 deletions lib/src/html/templates.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const _partials = const <String>[
'features',
'documentation',
'name_summary',
'search_sidebar',
'sidebar_for_class',
'sidebar_for_category',
'sidebar_for_enum',
Expand Down
3 changes: 0 additions & 3 deletions lib/src/model_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ import 'dart:io';
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/element/element.dart';
import 'package:analyzer/src/dart/ast/utilities.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/generated/source_io.dart';
import 'package:dartdoc/src/model.dart';

final Map<String, String> _fileContents = <String, String>{};
Expand Down
1 change: 1 addition & 0 deletions lib/templates/404error.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{>head}}

<div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5><span class="package-name">{{self.name}}</span> <span class="package-kind">{{self.kind}}</span></h5>
{{>packages}}
</div>
Expand Down
2 changes: 0 additions & 2 deletions lib/templates/_head.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
<div id="overlay-under-drawer"></div>

<header id="title">
{{^navLinks.isEmpty}}
<button id="sidenav-left-toggle" type="button">&nbsp;</button>
{{/navLinks.isEmpty}}
<ol class="breadcrumbs gt-separated dark hidden-xs">
{{#navLinks}}
<li><a href="{{href}}">{{name}}</a></li>
Expand Down
21 changes: 21 additions & 0 deletions lib/templates/_search_sidebar.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<header id="header-search-sidebar" class="hidden-l">
<form class="search-sidebar" role="search">
<input type="text" id="search-sidebar" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
</form>
</header>

<ol class="breadcrumbs gt-separated dark hidden-l" id="sidebar-nav">
{{#navLinks}}
<li><a href="{{href}}">{{name}}</a></li>
{{/navLinks}}
{{#navLinksWithGenerics}}
<li><a href="{{href}}">{{name}}{{#hasGenericParameters}}<span class="signature">{{{genericParameters}}}</span>{{/hasGenericParameters}}</a></li>
{{/navLinksWithGenerics}}
{{^hasHomepage}}
<li class="self-crumb">{{{ layoutTitle }}}</li>
{{/hasHomepage}}
{{#hasHomepage}}
<li><a href="{{homepage}}">{{{ layoutTitle }}}</a></li>
{{/hasHomepage}}
</ol>

1 change: 1 addition & 0 deletions lib/templates/category.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{>head}}

<div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5><span class="package-name">{{parent.name}}</span> <span class="package-kind">{{parent.kind}}</span></h5>
{{>packages}}
</div>
Expand Down
1 change: 1 addition & 0 deletions lib/templates/class.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{>head}}

<div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{>sidebar_for_library}}
</div>
Expand Down
1 change: 1 addition & 0 deletions lib/templates/constant.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{>head}}

<div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{>sidebar_for_class}}
</div><!--/.sidebar-offcanvas-left-->
Expand Down
1 change: 1 addition & 0 deletions lib/templates/constructor.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{>head}}

<div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{>sidebar_for_class}}
</div><!--/.sidebar-offcanvas-left-->
Expand Down
1 change: 1 addition & 0 deletions lib/templates/enum.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{>head}}

<div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{>sidebar_for_library}}
</div>
Expand Down
1 change: 1 addition & 0 deletions lib/templates/function.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{>head}}

<div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{>sidebar_for_library}}
</div><!--/.sidebar-offcanvas-left-->
Expand Down
3 changes: 2 additions & 1 deletion lib/templates/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{{>head}}

<div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
<h5><span class="package-name">{{self.name}}</span> <span class="package-kind">{{self.kind}}</span></h5>
{{>search_sidebar}}
<h5 class="hidden-xs"><span class="package-name">{{self.name}}</span> <span class="package-kind">{{self.kind}}</span></h5>
{{>packages}}
</div>

Expand Down
1 change: 1 addition & 0 deletions lib/templates/library.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{>head}}

<div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5><span class="package-name">{{parent.name}}</span> <span class="package-kind">{{parent.kind}}</span></h5>
{{>packages}}
</div>
Expand Down
1 change: 1 addition & 0 deletions lib/templates/method.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{>head}}

<div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{>sidebar_for_class}}
</div><!--/.sidebar-offcanvas-->
Expand Down
1 change: 1 addition & 0 deletions lib/templates/mixin.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{>head}}

<div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{>sidebar_for_library}}
</div>
Expand Down
1 change: 1 addition & 0 deletions lib/templates/property.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{>head}}

<div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{>sidebar_for_class}}
</div><!--/.sidebar-offcanvas-->
Expand Down
1 change: 1 addition & 0 deletions lib/templates/top_level_constant.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{>head}}

<div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{>sidebar_for_library}}
</div><!--/.sidebar-offcanvas-left-->
Expand Down
1 change: 1 addition & 0 deletions lib/templates/top_level_property.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{>head}}

<div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{>sidebar_for_library}}
</div><!--/.sidebar-offcanvas-left-->
Expand Down
1 change: 1 addition & 0 deletions lib/templates/typedef.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{{>head}}

<div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
{{>search_sidebar}}
<h5>{{parent.name}} {{parent.kind}}</h5>
{{>sidebar_for_library}}
</div><!--/.sidebar-offcanvas-left-->
Expand Down
11 changes: 11 additions & 0 deletions testing/test_package_docs/__404error.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions testing/test_package_docs/anonymous_library/doesStuff.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions testing/test_package_docs/another_anonymous_lib/greeting.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading