-
Notifications
You must be signed in to change notification settings - Fork 4
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
1 parent
f354b83
commit 7687b1f
Showing
4 changed files
with
106 additions
and
107 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 |
---|---|---|
@@ -1,63 +1,53 @@ | ||
<style> | ||
/* Style the button that is used to open and close the collapsible content */ | ||
.collapsible { | ||
background-color: #eee; | ||
color: #444; | ||
cursor: pointer; | ||
padding: 18px; | ||
width: 100%; | ||
border: none; | ||
text-align: left; | ||
outline: none; | ||
font-size: 15px; | ||
} | ||
|
||
/* Add a background color to the button if it is clicked on (add the .active class with JS), and when you move the mouse over it (hover) */ | ||
.active, .collapsible:hover { | ||
background-color: #ccc; | ||
} | ||
|
||
/* Style the collapsible content. Note: hidden by default */ | ||
.content { | ||
padding: 0 18px; | ||
display: none; | ||
overflow: hidden; | ||
background-color: #ffffff; | ||
} | ||
|
||
.collapsible:after { | ||
content: '+'; /* Unicode character for "plus" sign (+) */ | ||
font-size: 18px; | ||
color: black; | ||
float: right; | ||
margin-left: 5px; | ||
} | ||
|
||
.active:after { | ||
content: "-"; /* Unicode character for "minus" sign (-) */ | ||
} | ||
</style> | ||
|
||
{% for tj in trajectories['trajectories'] %} | ||
<button type="button" class="collapsible"><b>Trajectory for Latitude {{tj['query']['latitude']}} Longitude {{tj['query']['longitude']}}</b></button> | ||
<div class="content"> | ||
{% include 'trajectory-item.html' %} | ||
</div> | ||
{% endfor %} | ||
|
||
<script> | ||
var coll = document.getElementsByClassName("collapsible"); | ||
var i; | ||
|
||
for (i = 0; i < coll.length; i++) { | ||
coll[i].addEventListener("click", function() { | ||
this.classList.toggle("active"); | ||
var content = this.nextElementSibling; | ||
if (content.style.display === "block") { | ||
content.style.display = "none"; | ||
} else { | ||
content.style.display = "block"; | ||
} | ||
}); | ||
} | ||
</script> | ||
.collapsible { | ||
background-color: #eee; | ||
color: #444; | ||
cursor: pointer; | ||
padding: 18px; | ||
width: 100%; | ||
border: none; | ||
text-align: left; | ||
outline: none; | ||
font-size: 15px; | ||
} | ||
|
||
.active, .collapsible:hover { | ||
background-color: #ccc; | ||
} | ||
|
||
.content { | ||
padding: 0 18px; | ||
display: none; | ||
overflow: hidden; | ||
background-color: #ffffff; | ||
} | ||
|
||
.collapsible:after { | ||
content: '+'; /* Unicode character for "plus" sign (+) */ | ||
font-size: 18px; | ||
color: black; | ||
float: right; | ||
margin-left: 5px; | ||
} | ||
|
||
.active:after { | ||
content: "-"; /* Unicode character for "minus" sign (-) */ | ||
} | ||
</style> | ||
|
||
{% for tj in trajectories['trajectories'] %} | ||
<button type="button" class="collapsible"><b>Trajectory for Latitude {{tj['query']['latitude']}} Longitude {{tj['query']['longitude']}}</b></button> | ||
<div class="content"> | ||
{% include 'trajectory-item.html' %} | ||
</div> | ||
{% endfor %} | ||
|
||
<script> | ||
document.querySelectorAll(".collapsible").forEach(button => { | ||
button.addEventListener("click", function() { | ||
this.classList.toggle("active"); | ||
let content = this.nextElementSibling; | ||
content.style.display = content.style.display === "block" ? "none" : "block"; | ||
}); | ||
}); | ||
</script> |
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