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

[almost working]

parent 257283f3
2 merge requests!9Develop,!8Repository
...@@ -12,25 +12,33 @@ ...@@ -12,25 +12,33 @@
<!-- Sidebar for Filters --> <!-- Sidebar for Filters -->
<div class= "sidenav"> <div class= "sidenav">
<button class="dropdown-btn"> <button class="dropdown-btn">
Type 2 Diabetes Type 2 Diabetes
<i class="fa fa-caret-down"></i> <i class="fa fa-caret-down"></i>
</button> </button>
<div id="filter"> <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"> T2 Diabetes</input>
<input type="checkbox" name="Type 2 diabetes" value="1"> No Type 2 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> </div>
<button class="dropdown-btn"> <button class="dropdown-btn">
Age Age
<i class="fa fa-caret-down"></i> <i class="fa fa-caret-down"></i>
</button> </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 @@ ...@@ -56,23 +64,35 @@
<body> <body>
<script> <script>
$(document).ready(function(){ $(document).ready(function(){
var results = [];
var data = {{ index .Site.Data.scRNAseq_huPr_D.updated_cleaned_json }};
$("input").click(function(){ $("input").click(function(){
var data = {{ index .Site.Data.scRNAseq_huPr_D.updated_cleaned_json }};
var name = $(this).attr("name"); 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 ($(this).prop("checked") == true){
if( $.inArray(name, data[0]) < 0){ var i;
alert ("Name: " + name + " Data: " + data ); 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); else if ($(this).prop("checked") == false){
} var i;
for (i=0; i<results.length; i++){
$("#displayFiles").text("true"); if (results[i][name]== value){
} results.splice(i, 1);
else if ($(this).prop("checked") == false){ i--;
$("#displayFiles").text("false"); }
} }
$('#'+id).text(results.length);
}
}); });
......
File added
File added
File added
/* the sidebar menu */ /* the sidebar menu */
.sidenav { .sidenav {
width: 20% ; width: 30% ;
position: fixed/* stay in place on scroll */ position: fixed/* stay in place on scroll */
/* z-index:1; /* stay on top*/ /* z-index:1; /* stay on top*/
top : 0; /* stay on top*/ top : 0; /* stay on top*/
left: 0; /* on left side of screen */ left: 0; /* on left side of screen */
background: #eee; background: #eee;
padding-top: 20px; padding-top: 2px;
padding-right:20px; padding-right:2px;
} }
/* Sidenav filters */ /* Sidenav filters */
.sidenav a, .dropdown-btn, #gender { .sidenav a, .dropdown-btn {
padding: 6px 15px 6px 6px; padding: 6px 6px 6px 6px;
text-decoration: none; text-decoration: none;
font-size: 15px;
color: #818181; color: #818181;
display: block; display: block;
border: none; border: none;
...@@ -27,6 +25,19 @@ ...@@ -27,6 +25,19 @@
outline: none; 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 */ /* On mouse-over */
.sidenav a:hover, .dropdown-btn:hover { .sidenav a:hover, .dropdown-btn:hover {
color: #cacfd2 ; 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