Skip to content

Commit d162731

Browse files
committed
Support page load with saved value for the input field
1 parent 21f4d19 commit d162731

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

static/shared/js/documentation.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ $(function() {
108108
$(this).prepend("<a class='header-anchor' href='#" + id + "'></a>");
109109
});
110110

111-
// # Search
111+
// #### Search ####
112112
var searchIndex,
113113
searchHits;
114114

@@ -139,6 +139,12 @@ $(function() {
139139

140140
return false;
141141
}
142+
143+
// Expand and activate search if the page loaded with a value set for the search field
144+
if ($("#searchfield").val().length > 0) {
145+
$("#search-container").addClass("active");
146+
searchForString($("#searchfield").val());
147+
}
142148

143149
// On input change, update the search results
144150
$("#searchfield").on("input", function(e) {

0 commit comments

Comments
 (0)