Skip to content

Commit

Permalink
Focus search when search button clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlock committed Aug 22, 2016
1 parent 1e88fd8 commit efc1cdf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion assets/js/src/cover.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@ $(function() {
$tagsButton,
$homeButton,
$cover,
$tagsOverlay;
$tagsOverlay,
$searchField;

$cover = $(".cover");
$navHeader = $("#default-nav-header");
$tagsButton = $(".tags-button");
$homeButton = $navHeader.find("#home-button");
$tagsOverlay = $(".tags-overlay");
$searchField = $("#search-field");

_expandCover = function() {
$cover.toggleClass("expanded");
Expand All @@ -32,6 +34,7 @@ $(function() {
_toggleTagsOverlay = function() {
$tagsOverlay.toggleClass("show");
$tagsButton.find("i").toggleClass("fa-search fa-close");
$searchField.focus();
};

// Checks if the search/tags overlay is visible
Expand Down

0 comments on commit efc1cdf

Please sign in to comment.