diff options
author | Graeme Yeates <yeatesgraeme@gmail.com> | 2016-06-27 17:11:46 -0400 |
---|---|---|
committer | Hubert Argasinski <argasinski.hubert@gmail.com> | 2016-06-29 02:01:20 -0400 |
commit | 22bced8a054fd5bca76247ea38e7e46836629fbf (patch) | |
tree | f24ae7651166ed578e3f7e675d4287ed9037b571 | |
parent | c45cab8d6ace1baa6044d0d6421196601f3e3c19 (diff) | |
download | async-22bced8a054fd5bca76247ea38e7e46836629fbf.tar.gz |
Fix search, WIP search linking
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | support/jsdoc/jsdoc-custom.css | 11 | ||||
-rw-r--r-- | support/jsdoc/jsdoc-custom.js | 26 | ||||
-rw-r--r-- | support/jsdoc/navbar.html | 4 |
4 files changed, 24 insertions, 29 deletions
@@ -161,11 +161,15 @@ The source is available for download from [GitHub](https://raw.githubusercontent.com/caolan/async/master/dist/async.min.js). Alternatively, you can install using npm: - npm install --save async +```bash +$ npm install --save async +``` As well as using Bower: - bower install async +```bash +$ bower install async +``` You can then `require()` async as normal: @@ -203,7 +207,9 @@ Usage: We also provide async as a collection of ES2015 modules, in an alternative `async-es` package on npm. - npm i -S async-es +```bash +$ npm install --save async-es +``` ```js import waterfall from 'async-es/waterfall'; diff --git a/support/jsdoc/jsdoc-custom.css b/support/jsdoc/jsdoc-custom.css index 78e5668..2a96957 100644 --- a/support/jsdoc/jsdoc-custom.css +++ b/support/jsdoc/jsdoc-custom.css @@ -6,6 +6,10 @@ background-color: #101010; } +.navbar-fixed-top .navbar-right { + padding-right: 10px; +} + .navbar .ion-social-github { font-size: 1.2em; } @@ -27,12 +31,13 @@ body nav { } #main { + position: fixed; float: none; + overflow-y: auto; margin-left: 250px; - position: fixed; + top: 50px; - overflow-y: auto; - height: 100%; + height: calc(100% - 50px); } .tt-menu { diff --git a/support/jsdoc/jsdoc-custom.js b/support/jsdoc/jsdoc-custom.js index 2b7871f..5072fb7 100644 --- a/support/jsdoc/jsdoc-custom.js +++ b/support/jsdoc/jsdoc-custom.js @@ -1,15 +1,4 @@ -// https://github.com/twbs/bootstrap/issues/1768 -function shiftWindow() { - scrollBy(0, -50); -} - -function fixAnchorPosition() { - if (location.hash) { - shiftWindow(); - } -} - -function initSearchBar() { +$(function initSearchBar() { var methodNames = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.whitespace, queryTokenizer: Bloodhound.tokenizers.whitespace, @@ -40,13 +29,8 @@ function initSearchBar() { templates: { header: '<h3 class="search-bar-header">Source Files</h3>' } + }).on('typeahead:select', function(ev, suggestion) { + var $el = document.getElementById('.' + suggestion) + $('html, body').animate({ scrollTop: $el.offsetTop }, 500); }); -} - -function init() { - fixAnchorPosition(); - window.addEventListener("hashchange", shiftWindow, false); - initSearchBar(); -} - -$(init); +}); diff --git a/support/jsdoc/navbar.html b/support/jsdoc/navbar.html index 996c1ce..e23b12e 100644 --- a/support/jsdoc/navbar.html +++ b/support/jsdoc/navbar.html @@ -16,12 +16,12 @@ </li> <li><a href="./index.html">Home</a></li> <li><a href="./docs.html">Docs</a></li> - <li><a href="https://github.com/caolan/async"><i class="icon ion-social-github" aria-hidden="true"></i></a></li> + <li><a href="https://github.com/caolan/async"><i class="ion-social-github" aria-hidden="true"></i></a></li> </ul> <ul class="nav navbar-nav navbar-right"> <form class="navbar-form navbar-left" role="search"> <div class="form-group"> - <input type="text" class="form-control" placeholder="Search"> + <input type="text" class="form-control typeahead" id="doc-search" placeholder="Search"> </div> </form> </ul> |