Skip to content

Commit

Permalink
Merge pull request #845 from fedspendingtransparency/map-search-fix
Browse files Browse the repository at this point in the history
fixing map search again
  • Loading branch information
anjenkin authored Jul 17, 2019
2 parents ff682a1 + 091baa9 commit fef74e4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion _includes/colleges/sectiontwo.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ <h1 class="accordion__heading">Instructions</h1>
<button type='button' title='Search' onclick='searchClick("map-function-buttons")'><img src='/assets/icons/magnifier.svg' /></button>
<div class="map-search">
<div class="map-search__input-wrapper">
<input class="map-search__input" id='map-keydown' placeholder="Search Institutions"></input>
<input id='map-search__input' class="map-search__input" onkeydown="filterSearch()" placeholder="Search Institutions"/>
</div>
<ul class="map-search__list" id="map-search-ul"></ul>
</div>
Expand Down
11 changes: 5 additions & 6 deletions assets/js/colleges-and-universities/institutions.js
Original file line number Diff line number Diff line change
Expand Up @@ -346,12 +346,10 @@ function createInstTable() {
});
};

function filterSearch() {
// handle input filter..
$('.map-search__input').keyup(function() {

function filterMapSearch() {
$('#map-search__input').keyup(function() {
var input, filter, ul, li, i, txtValue;
input = document.getElementById('map-keydown');
input = document.getElementById('map-search__input');
filter = input.value.toUpperCase();
ul = document.getElementById("map-search-ul");
li = ul.getElementsByTagName('li');
Expand All @@ -371,6 +369,7 @@ function filterSearch() {
function filterSearchMobile() {
// handle input filter..
$('#mobile-keydown').keyup(function() {
console.log('mobile keydown pressed');
const filter = document.getElementById('mobile-keydown').value.toUpperCase();
const li = document.getElementById("map-search-ul--mobile").getElementsByTagName('li');

Expand Down Expand Up @@ -420,10 +419,10 @@ function searchMobileToggle() {

$(document).ready(function(){
createMapbox();
filterMapSearch();
searchToggle();
searchMobileToggle();
filterSearchMobile();
filterSearch();
createInstTable();
});

0 comments on commit fef74e4

Please sign in to comment.