Skip to content

Commit

Permalink
work on lake search and slider hover for tooltip
Browse files Browse the repository at this point in the history
issue #5
  • Loading branch information
jwhaney committed May 24, 2018
1 parent f930414 commit fe5fc92
Show file tree
Hide file tree
Showing 11 changed files with 55 additions and 3 deletions.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions lakegallery/map/static/map/style.css
Expand Up @@ -39,6 +39,15 @@ body {
opacity: .4;
}

#search {
max-width: auto;
}

#glyph-search {
height: 25px;
width: 25px;
}

/*LEAFLET FOR ALL*/
.leaflet-control-layers-base > label > div > input {
display: none;
Expand Down
40 changes: 37 additions & 3 deletions lakegallery/map/templates/map/base.html
Expand Up @@ -76,7 +76,41 @@
<a class="nav-link dropdown-toggle" href="http://example.com" id="navbarDropdownMenuLink" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Lakes
</a>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdownMenuLink">
<div class="dropdown-menu dropdown-menu-right" id="lakeMenu" aria-labelledby="navbarDropdownMenuLink">
<script>
//function to search and filter lakes
function lakeSearch() {
var input, filter, lakeMenu, atags, atagsLength, i;
input = document.getElementById("search");
filter = input.value.toUpperCase();
lakeMenu = document.getElementById("lakeMenu");
atags = lakeMenu.getElementsByTagName("a");
atagsLength = atags.length;

// Loop through all enabled lake atags, and hide those who don't match the search query
for (i = 0; i < atagsLength; i++) {
var atag = atags[i];
if (atag) {
if (atag.innerHTML.toUpperCase().indexOf(filter) > -1) {
atag.style.display = "";
} else {
atag.style.display = "none";
}
}
}
}

//function to clear search text when click image to right of search/filter
function clearSearch() {
var searchText = document.getElementById("search").value;
searchText = "";
// $("#search").value("test");
}
</script>
<div class="btn-group">
<input type="text" id="search" class="form-control" onkeyup="lakeSearch();" placeholder="Search for a lake...">
<img id="clearSearch" src="{% static 'map/images/glyphicons-remove-circle.png' %}" onclick="clearSearch();"/>
</div>
{% for l in header_lakes %}
{% if l.class == "enabled" %}
<a class="dropdown-item {{ l.class }}" href="/{{ l.region }}/{{ l.name }}">{{ l.name }}</a>
Expand All @@ -90,11 +124,11 @@
</a>
</li>
</ul>

</div>
</nav>

{% block content %}
{% endblock %}
</body>
</html>
</html>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions lakegallery/static/map/style.css
Expand Up @@ -39,6 +39,15 @@ body {
opacity: .4;
}

#search {
max-width: auto;
}

#glyph-search {
height: 25px;
width: 25px;
}

/*LEAFLET FOR ALL*/
.leaflet-control-layers-base > label > div > input {
display: none;
Expand Down

0 comments on commit fe5fc92

Please sign in to comment.