summaryrefslogtreecommitdiffstats
path: root/theme/javascript/core
diff options
context:
space:
mode:
authorSamy Pessé <samypesse@gmail.com>2014-04-06 16:20:31 -0700
committerSamy Pessé <samypesse@gmail.com>2014-04-06 16:20:31 -0700
commitd2f62fd109e6a30592f1a9767dfc2a0e7293f0cc (patch)
treec9201b8909dae72f557d1c69c35e1d58bd660c57 /theme/javascript/core
parentf24b66f2c4e1e385168017a2ec06cb262a384cf1 (diff)
downloadgitbook-d2f62fd109e6a30592f1a9767dfc2a0e7293f0cc.zip
gitbook-d2f62fd109e6a30592f1a9767dfc2a0e7293f0cc.tar.gz
gitbook-d2f62fd109e6a30592f1a9767dfc2a0e7293f0cc.tar.bz2
Move search bar as global
Diffstat (limited to 'theme/javascript/core')
-rw-r--r--theme/javascript/core/search.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/theme/javascript/core/search.js b/theme/javascript/core/search.js
index 9202f04..e674bb0 100644
--- a/theme/javascript/core/search.js
+++ b/theme/javascript/core/search.js
@@ -2,11 +2,11 @@ define([
"jQuery",
"lodash",
"lunr",
- "core/state",
- "core/sidebar"
-], function($, _, lunr, state, sidebar) {
+ "core/state"
+], function($, _, lunr, state) {
var index = null;
- var $searchInput = sidebar.$el.find(".book-search input");
+ var $searchBar = state.$book.find(".book-search");
+ var $searchInput = $searchBar.find("input");
// Load complete index
var loadIndex = function() {
@@ -37,7 +37,7 @@ define([
if (state != null && isSearchOpen() == _state) return;
- sidebar.$el.toggleClass("with-search", _state);
+ state.$book.toggleClass("with-search", _state);
// If search bar is open: focus input
if (isSearchOpen()) {
@@ -49,7 +49,7 @@ define([
// Return true if search bar is open
var isSearchOpen = function() {
- return sidebar.$el.hasClass("with-search");
+ return state.$book.hasClass("with-search");
};