-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
427 additions
and
283 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
const $ = jQuery; | ||
window.over_sb = null; // fix issue with jQuery autoComplete v1.0.7 | ||
|
||
export default function() { | ||
const $dynamicSearch = $('.dynamic-search'); | ||
const $dynamicSearchTrigger = $('.js-dynamic-search'); | ||
const $dynamicSearchClose = $('.js-close-dynamic-search'); | ||
|
||
$dynamicSearchTrigger.on('click', function(e) { | ||
if ($dynamicSearch.length) { | ||
$dynamicSearch.toggleClass('is-visible'); | ||
$(document.body).toggleClass('has-open-dynamic-search'); | ||
} | ||
|
||
setTimeout(() => { | ||
$('#search_input').focus(); | ||
}, 100); | ||
|
||
e.preventDefault(); | ||
}); | ||
|
||
$dynamicSearchClose.on('click', function(e) { | ||
$('#search_input').blur(); | ||
$dynamicSearch.removeClass('is-visible'); | ||
$(document.body).removeClass('has-open-dynamic-search'); | ||
e.preventDefault(); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,10 @@ body { | |
overflow: hidden; | ||
} | ||
} | ||
|
||
&.has-open-dynamic-search { | ||
overflow: hidden; | ||
} | ||
} | ||
|
||
h1, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<section class="live-search"> | ||
|
||
<div class="ct-container"> | ||
|
||
{% if not is_search_page %} | ||
<button class="close-dynamic-search-button js-close-dynamic-search" aria-label="Close dynamic search"> | ||
<span class="icon-close"></span> | ||
</button> | ||
{% endif %} | ||
|
||
<h2 class="search-title">{{ search_strings.search_label }}</h2> | ||
|
||
<!-- We also included results for: --> | ||
<!-- Does this even work? --> | ||
{% if ( corrected_term ) %} | ||
{{ corrected_term }} | ||
{% endif %} | ||
|
||
<form | ||
id="search_form_inner" role="search" action="{{ data_nav_bar.home_url }}"> | ||
<!-- Main search field --> | ||
<div class="form-group search fluid"> | ||
<input id="search_input" class="search-autocomplete" type="search" name="s" placeholder="{{ search_strings.start_typing }}" value="{{ search_query|e('wp_kses_post')|raw }}"> | ||
<button class="button primary" type="submit">{{ search_strings.search_label }}</button> | ||
</div> | ||
|
||
<div class="lds-spinner"> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
<div></div> | ||
</div> | ||
</form> | ||
|
||
<div hidden id="ajax-search-issues" class="fade-out"> | ||
<h5> | ||
{{ search_strings.issue }} | ||
</h5> | ||
<div class="results-list"></div> | ||
</div> | ||
|
||
<div hidden id="ajax-search-topics" class="fade-out"> | ||
<h5>{{ search_strings.topic }}</h5> | ||
<div class="results-list"></div> | ||
</div> | ||
|
||
<div hidden id="ajax-search-posts" class="fade-out"> | ||
<h5>{{ search_strings.posts }}</h5> | ||
<div class="results-list"></div> | ||
</div> | ||
|
||
</div> | ||
</section> |
Oops, something went wrong.