From 9a6195abd1867e602234f182d73029e700612bd4 Mon Sep 17 00:00:00 2001 From: zsloan Date: Tue, 15 Dec 2020 13:55:24 -0600 Subject: Fixed Reset button to also reset hidden rows + changed Hide No Value button to change its text when active --- wqflask/wqflask/static/new/javascript/show_trait.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/wqflask/wqflask/static/new/javascript/show_trait.js b/wqflask/wqflask/static/new/javascript/show_trait.js index e8768325..5dc9e456 100644 --- a/wqflask/wqflask/static/new/javascript/show_trait.js +++ b/wqflask/wqflask/static/new/javascript/show_trait.js @@ -741,7 +741,6 @@ hide_no_value_filter = function( settings, data, dataIndex ) { } hide_no_value = function() { - tables = ['samples_primary', 'samples_other']; filter_active = $(this).data("active"); for (_i = 0, _len = tables.length; _i < _len; _i++) { @@ -749,9 +748,11 @@ hide_no_value = function() { if ($('#' + table).length) { table_api = $('#' + table).DataTable(); if (filter_active == "true"){ + $(this).val("Hide No Value") table_api.draw(); $(this).data("active", "false"); } else { + $(this).val("Show No Value") $.fn.dataTable.ext.search.push(hide_no_value_filter); table_api.search(); table_api.draw(); @@ -775,6 +776,7 @@ $('#block_outliers').click(block_outliers); reset_samples_table = function() { $('input[name="transform"]').val(""); $('span[name="transform_text"]').text("") + $('#hide_no_value').val("Hide No Value") tables = ['samples_primary', 'samples_other']; for (_i = 0, _len = tables.length; _i < _len; _i++) { table = tables[_i]; @@ -792,6 +794,7 @@ reset_samples_table = function() { this_node.value = this_node.attributes["data-value"].value; } } + table_api.draw(); } } }; -- cgit v1.2.3