aboutsummaryrefslogtreecommitdiff
path: root/wqflask
diff options
context:
space:
mode:
authorzsloan2021-01-12 11:09:11 -0600
committerzsloan2021-01-12 11:09:11 -0600
commit3c0715dc52dc583d8a84907a9ba41a799ed3068a (patch)
tree73d1312f5f10a742e7cd7e3a12c5405fc3d39907 /wqflask
parent2016470a13945e6bb833d28583de9e0877fe91eb (diff)
downloadgenenetwork2-3c0715dc52dc583d8a84907a9ba41a799ed3068a.tar.gz
Added a line that redraws the DataTable, which fixes its initial scroll height
Diffstat (limited to 'wqflask')
-rw-r--r--wqflask/wqflask/templates/search_result_page.html37
1 files changed, 9 insertions, 28 deletions
diff --git a/wqflask/wqflask/templates/search_result_page.html b/wqflask/wqflask/templates/search_result_page.html
index 411a6628..5fe65c00 100644
--- a/wqflask/wqflask/templates/search_result_page.html
+++ b/wqflask/wqflask/templates/search_result_page.html
@@ -146,6 +146,7 @@
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='js_alt/md5.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTables/js/jquery.dataTables.min.js') }}"></script>
+ <script language="javascript" type="text/javascript" src="https://cdn.datatables.net/scroller/2.0.2/js/dataTables.scroller.min.js"></script>
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='jszip/jszip.min.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/plugins/sorting/natural.js') }}"></script>
<script language="javascript" type="text/javascript" src="{{ url_for('js', filename='DataTablesExtensions/buttons/js/dataTables.buttons.min.js') }}"></script>
@@ -383,36 +384,16 @@
}{% endif %}
],
"order": [[1, "asc" ]],
- {% if dataset.type != 'Geno' %}
- buttons: [
- {
- extend: 'columnsToggle',
- columns: function( idx, data, node ) {
- if (idx != 0) {
- return true;
- } else {
- return false;
- }
- },
- postfixButtons: [ 'colvisRestore' ]
- }
- ],
- 'sDom': "Bpitirp",
- {% else %}
- 'sDom': "pitirp",
- {% endif %}
- 'iDisplayLength': 500,
- 'deferRender': true,
- 'paging': true,
- 'orderClasses': true,
- 'processing': true,
- 'bServerSide': true,
- 'sAjaxSource': '/search_table'+getParams(window.location.href),
- 'infoCallback': function(settings, start, end, max, total, pre) {
- return "Showing " + start + " to " + (start + this.api().data().length - 1) + " of " + total + " entries";
- }
+ 'sDom': "itir",
+ "autoWidth": true,
+ "bSortClasses": false,
+ "scrollY": "100vh",
+ "scroller": true,
+ "scrollCollapse": true
} );
+ trait_table.draw(); //ZS: This makes the table adjust its height properly on initial load
+
$('.toggle-vis').on( 'click', function (e) {
e.preventDefault();