aboutsummaryrefslogtreecommitdiff
path: root/wqflask/wqflask/templates/correlation_page.html
diff options
context:
space:
mode:
authorAlexander Kabui2020-12-04 21:41:28 +0300
committerAlexander Kabui2020-12-04 21:41:28 +0300
commitf67f0f0d8f62f8bb6f8b708886c6ec2252450aeb (patch)
treead01d1e1f2e118ddb263d325a8b64b43064366d6 /wqflask/wqflask/templates/correlation_page.html
parent9b7c09e14576a39c3f986e5b6e633b0380a72095 (diff)
parent8084309bdfa46e29d3cc941911fa25b23f8400d5 (diff)
downloadgenenetwork2-f67f0f0d8f62f8bb6f8b708886c6ec2252450aeb.tar.gz
Merge branch 'testing' of https://github.com/genenetwork/genenetwork2 into bugfix/markdown-links-fix
Diffstat (limited to 'wqflask/wqflask/templates/correlation_page.html')
-rw-r--r--wqflask/wqflask/templates/correlation_page.html54
1 files changed, 16 insertions, 38 deletions
diff --git a/wqflask/wqflask/templates/correlation_page.html b/wqflask/wqflask/templates/correlation_page.html
index 6419b185..aa74abf5 100644
--- a/wqflask/wqflask/templates/correlation_page.html
+++ b/wqflask/wqflask/templates/correlation_page.html
@@ -75,6 +75,7 @@
<div>
<form id="export_form" method="POST" action="/export_traits_csv">
<button class="btn btn-default" id="select_all" type="button"><span class="glyphicon glyphicon-ok"></span> Select All</button>
+ <button class="btn btn-default" id="invert" type="button"><span class="glyphicon glyphicon-adjust"></span> Invert</button>
<button class="btn btn-success" id="add" type="button" disabled><span class="glyphicon glyphicon-plus-sign"></span> Add</button>
<input type="hidden" name="database_name" id="database_name" value="None">
<input type="hidden" name="export_data" id="export_data" value="">
@@ -256,41 +257,6 @@
{% endif %}
$(document).ready( function () {
-
- $('#trait_table tr').click(function(event) {
- if (event.target.type !== 'checkbox') {
- $(':checkbox', this).trigger('click');
- }
- });
-
- function change_buttons() {
- buttons = ["#add", "#remove"];
- num_checked = $('.trait_checkbox:checked').length;
- if (num_checked === 0) {
- for (_i = 0, _len = buttons.length; _i < _len; _i++) {
- button = buttons[_i];
- $(button).prop("disabled", true);
- }
- } else {
- for (_j = 0, _len2 = buttons.length; _j < _len2; _j++) {
- button = buttons[_j];
- $(button).prop("disabled", false);
- }
- }
- if ($(this).is(":checked")) {
- if (!$(this).closest('tr').hasClass('selected')) {
- $(this).closest('tr').addClass('selected')
- }
- }
- else {
- if ($(this).closest('tr').hasClass('selected')) {
- $(this).closest('tr').removeClass('selected')
- }
- }
- }
-
- console.time("Creating table");
-
table_conf = {
buttons: [
{
@@ -305,6 +271,20 @@
postfixButtons: [ 'colvisRestore' ]
}
],
+ 'drawCallback': function( settings ) {
+ $('#trait_table tr').off().on("click", function(event) {
+ if (event.target.type !== 'checkbox' && event.target.tagName.toLowerCase() !== 'a') {
+ var obj =$(this).find('input');
+ obj.prop('checked', !obj.is(':checked'));
+ }
+ if ($(this).hasClass("selected")){
+ $(this).removeClass("selected")
+ } else {
+ $(this).addClass("selected")
+ }
+ });
+ $('.trait_checkbox:checkbox').on("change", change_buttons);
+ },
"data": table_json,
"columns": [
{
@@ -557,7 +537,7 @@
"sDom": "itir",
"autoWidth": true,
"bSortClasses": false,
- "scrollY": "50vh",
+ "scrollY": "100vh",
"scroller": true,
"scrollCollapse": true
}
@@ -570,8 +550,6 @@
} );
} ).draw();
- console.timeEnd("Creating table");
-
$('.toggle-vis').on('click', function (e) {
e.preventDefault();