Skip to content
Snippets Groups Projects
Commit 3eb88fb5 authored by Nicole Finks's avatar Nicole Finks
Browse files

[almost working]

parent 257283f3
Branches
Tags
2 merge requests!9Develop,!8Repository
......@@ -12,25 +12,33 @@
<!-- Sidebar for Filters -->
<div class= "sidenav">
<button class="dropdown-btn">
Type 2 Diabetes
<i class="fa fa-caret-down"></i>
</button>
<div id="filter">
<input type="checkbox" name="Type 2 diabetes" value="0"> Has Type 2 Diabetes</input><br>
<input type="checkbox" name="Type 2 diabetes" value="1"> No Type 2 Diabetes </input>
<input type="checkbox" name="Type 2 diabetes" value="1"> T2 Diabetes</input>
<p class="numbers" id="Type2diabetes1">#</p>
<br>
<input type="checkbox" name="Type 2 diabetes" value="0"> No T2 Diabetes </input>
<p class = "numbers" id="Type2diabetes0">#</p>
</div>
<button class="dropdown-btn">
Age
<i class="fa fa-caret-down"></i>
</button>
<div id="filter">
<input value= "Enter Age Here"></input>
<p id="displayFiles">replace me</p>
</div>
</div>
<p id="displayFiles">0</p>
</div>
......@@ -56,23 +64,35 @@
<body>
<script>
$(document).ready(function(){
var results = [];
var data = {{ index .Site.Data.scRNAseq_huPr_D.updated_cleaned_json }};
$("input").click(function(){
var data = {{ index .Site.Data.scRNAseq_huPr_D.updated_cleaned_json }};
var name = $(this).attr("name");
var value = $(this).attr("value");
var id = name + value;
id= id.replace(/\s+/g, '');
if ($(this).prop("checked") == true){
if( $.inArray(name, data[0]) < 0){
alert ("Name: " + name + " Data: " + data );
var i;
for (i =0; i < data.length; i++){
if( data[i][name] == value){
results.push(data[i]);
$('#'+id).text(results.length);
}
}
else if ($.inArray(name, data[0]) > 0){
alert ("Name is in array " +name);
}
$("#displayFiles").text("true");
}
else if ($(this).prop("checked") == false){
$("#displayFiles").text("false");
}
}
else if ($(this).prop("checked") == false){
var i;
for (i=0; i<results.length; i++){
if (results[i][name]== value){
results.splice(i, 1);
i--;
}
}
$('#'+id).text(results.length);
}
});
......
File added
File added
File added
/* the sidebar menu */
.sidenav {
width: 20% ;
width: 30% ;
position: fixed/* stay in place on scroll */
/* z-index:1; /* stay on top*/
top : 0; /* stay on top*/
left: 0; /* on left side of screen */
background: #eee;
padding-top: 20px;
padding-right:20px;
padding-top: 2px;
padding-right:2px;
}
/* Sidenav filters */
.sidenav a, .dropdown-btn, #gender {
padding: 6px 15px 6px 6px;
.sidenav a, .dropdown-btn {
padding: 6px 6px 6px 6px;
text-decoration: none;
font-size: 15px;
color: #818181;
display: block;
border: none;
......@@ -27,6 +25,19 @@
outline: none;
}
.numbers {
text-align: right;
padding: 0px 0px 0px 0px;
float: right;
}
#filter {
padding-left: 15px;
font-size: 85%;
clear: left;
}
/* On mouse-over */
.sidenav a:hover, .dropdown-btn:hover {
color: #cacfd2 ;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment