diff options
author | Samy Pessé <samypesse@gmail.com> | 2014-05-23 22:28:36 +0200 |
---|---|---|
committer | Samy Pessé <samypesse@gmail.com> | 2014-05-23 22:28:36 +0200 |
commit | 6340a64cff5cd67c858c566108b5c8cc09a92103 (patch) | |
tree | eba913dd637d8a2f9c980de29a68cd81fca1860b /theme/javascript/core/sidebar.js | |
parent | 96bcfa4e20fb32c57a0c872716b457f300fc31ad (diff) | |
download | gitbook-6340a64cff5cd67c858c566108b5c8cc09a92103.zip gitbook-6340a64cff5cd67c858c566108b5c8cc09a92103.tar.gz gitbook-6340a64cff5cd67c858c566108b5c8cc09a92103.tar.bz2 |
Fix #235: search after navigation to another page
Diffstat (limited to 'theme/javascript/core/sidebar.js')
-rwxr-xr-x | theme/javascript/core/sidebar.js | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/theme/javascript/core/sidebar.js b/theme/javascript/core/sidebar.js index 0d09b58..828dc73 100755 --- a/theme/javascript/core/sidebar.js +++ b/theme/javascript/core/sidebar.js @@ -1,11 +1,10 @@ define([ + "jQuery", "lodash", "utils/storage", "utils/platform", "core/state" -], function(_, storage, platform, state) { - var $summary = state.$book.find(".book-summary"); - +], function($, _, storage, platform, state) { // Toggle sidebar with or withour animation var toggleSidebar = function(_state, animation) { if (state != null && isOpen() == _state) return; @@ -38,6 +37,8 @@ define([ // Filter summary with a list of path var filterSummary = function(paths) { + var $summary = $(".book-summary"); + $summary.find("li").each(function() { var path = $(this).data("path"); var st = paths == null || _.contains(paths, path); @@ -48,7 +49,6 @@ define([ }; return { - $el: $summary, init: init, toggle: toggleSidebar, filter: filterSummary |