diff options
author | zsloan | 2020-12-03 17:18:21 -0600 |
---|---|---|
committer | GitHub | 2020-12-03 17:18:21 -0600 |
commit | 1587a2f047ea33b44b0e16d02d772176d19e0f17 (patch) | |
tree | b9d526ecde4dcaa62e2a1035e80ff30d291d10de /wqflask/wqflask/templates/correlation_page.html | |
parent | 1e7a2082a84e260b61349a77de4e8b936fae0123 (diff) | |
parent | 3e83660bbf13949eaefd9c5a94ab82444d4c6218 (diff) | |
download | genenetwork2-1587a2f047ea33b44b0e16d02d772176d19e0f17.tar.gz |
Merge pull request #500 from zsloan/bug/fix_correlation_export
Bug/fix correlation export
Diffstat (limited to 'wqflask/wqflask/templates/correlation_page.html')
-rw-r--r-- | wqflask/wqflask/templates/correlation_page.html | 54 |
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(); |