Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
django-rest-framework
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
django-rest-framework
Commits
ea1a8f4a
Commit
ea1a8f4a
authored
Jul 29, 2015
by
José Padilla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix weird search behavior. Closes #3197
parent
0b345516
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
28 deletions
+28
-28
docs_theme/js/theme.js
+28
-28
No files found.
docs_theme/js/theme.js
View file @
ea1a8f4a
function
getSearchTerm
()
{
var
sPageURL
=
window
.
location
.
search
.
substring
(
1
);
var
sURLVariables
=
sPageURL
.
split
(
'&'
);
for
(
var
i
=
0
;
i
<
sURLVariables
.
length
;
i
++
)
{
var
sParameterName
=
sURLVariables
[
i
].
split
(
'='
);
if
(
sParameterName
[
0
]
==
'q'
)
{
return
sParameterName
[
1
];
}
var
getSearchTerm
=
function
()
{
var
sPageURL
=
window
.
location
.
search
.
substring
(
1
);
var
sURLVariables
=
sPageURL
.
split
(
'&'
);
for
(
var
i
=
0
;
i
<
sURLVariables
.
length
;
i
++
)
{
var
sParameterName
=
sURLVariables
[
i
].
split
(
'='
);
if
(
sParameterName
[
0
]
===
'q'
)
{
return
sParameterName
[
1
];
}
}
}
};
$
(
function
()
{
var
initialise_search
=
function
(){
require
.
config
({
"baseUrl"
:
"/mkdocs/js"
});
require
([
"search"
,]);
}
var
initilizeSearch
=
function
()
{
require
.
config
({
baseUrl
:
'/mkdocs/js'
});
require
([
'search'
]);
};
var
search_term
=
getSearchTerm
();
if
(
search_term
){
$
(
'#mkdocs_search_modal'
).
modal
();
}
$
(
function
()
{
var
searchTerm
=
getSearchTerm
(),
$searchModal
=
$
(
'#mkdocs_search_modal'
),
$searchQuery
=
$searchModal
.
find
(
'#mkdocs-search-query'
),
$searchResults
=
$searchModal
.
find
(
'#mkdocs-search-results'
);
$
(
'pre code'
).
parent
().
addClass
(
'prettyprint well'
);
$
(
'pre code'
).
parent
().
addClass
(
'prettyprint well'
);
$
(
document
).
on
(
"submit"
,
"#mkdocs_search_modal form"
,
function
(
e
)
{
$
(
"#mkdocs-search-results"
).
html
(
"Searching..."
);
initialise_search
(
);
return
false
;
});
if
(
searchTerm
)
{
$searchQuery
.
val
(
searchTerm
);
$searchResults
.
text
(
'Searching...'
);
$searchModal
.
modal
()
;
}
$searchModal
.
on
(
'shown'
,
function
()
{
$searchQuery
.
focus
();
initilizeSearch
();
});
});
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment