Skip to content

Commit

Permalink
fixing map search again
Browse files Browse the repository at this point in the history
  • Loading branch information
xjackk committed Jul 17, 2019
1 parent ff682a1 commit 091baa9
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 091baa9

Please sign in to comment.