aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wqflask/wqflask/static/new/javascript/draw_corr_scatterplot.js5
-rw-r--r--wqflask/wqflask/static/new/javascript/get_traits_from_collection.js48
2 files changed, 27 insertions, 26 deletions
diff --git a/wqflask/wqflask/static/new/javascript/draw_corr_scatterplot.js b/wqflask/wqflask/static/new/javascript/draw_corr_scatterplot.js
index 956e0467..1bae8773 100644
--- a/wqflask/wqflask/static/new/javascript/draw_corr_scatterplot.js
+++ b/wqflask/wqflask/static/new/javascript/draw_corr_scatterplot.js
@@ -337,14 +337,13 @@ function getdata() {
continue
}
+ sizev = 10;
+ datav = 0;
if (size_cofactor_vals.length > 0){
if (cofactor_samples.indexOf(js_data.indIDs[j])) {
datav = size_cofactor_vals[j]
sizev = map1to2(datamin, datamax, sizemin, sizemax, datav);
}
- } else {
- datav = 0;
- sizev = 10;
}
x_values.push(js_data.data[0][j])
diff --git a/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js b/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js
index 6f03b98f..4ec62157 100644
--- a/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js
+++ b/wqflask/wqflask/static/new/javascript/get_traits_from_collection.js
@@ -41,29 +41,31 @@ $('#trait_table').dataTable( {
"orderClasses": true
} );
-$('#collection_table').dataTable( {
- "createdRow": function ( row, data, index ) {
- if ($('td', row).eq(2).text().length > 40) {
- $('td', row).eq(2).text($('td', row).eq(2).text().substring(0, 40));
- $('td', row).eq(2).text($('td', row).eq(2).text() + '...')
- }
- if ($('td', row).eq(4).text().length > 50) {
- $('td', row).eq(4).text($('td', row).eq(4).text().substring(0, 50));
- $('td', row).eq(4).text($('td', row).eq(4).text() + '...')
- }
- },
- "columnDefs": [ {
- "targets": 0,
- "orderable": false
- } ],
- "order": [[1, "asc" ]],
- "sDom": "ZRtr",
- "iDisplayLength": -1,
- "autoWidth": true,
- "bSortClasses": false,
- "paging": false,
- "orderClasses": true
-} );
+if ( ! $.fn.DataTable.isDataTable( '#collection_table' ) ) {
+ $('#collection_table').dataTable( {
+ "createdRow": function ( row, data, index ) {
+ if ($('td', row).eq(2).text().length > 40) {
+ $('td', row).eq(2).text($('td', row).eq(2).text().substring(0, 40));
+ $('td', row).eq(2).text($('td', row).eq(2).text() + '...')
+ }
+ if ($('td', row).eq(4).text().length > 50) {
+ $('td', row).eq(4).text($('td', row).eq(4).text().substring(0, 50));
+ $('td', row).eq(4).text($('td', row).eq(4).text() + '...')
+ }
+ },
+ "columnDefs": [ {
+ "targets": 0,
+ "orderable": false
+ } ],
+ "order": [[1, "asc" ]],
+ "sDom": "ZRtr",
+ "iDisplayLength": -1,
+ "autoWidth": true,
+ "bSortClasses": false,
+ "paging": false,
+ "orderClasses": true
+ } );
+}
collection_click = function() {
var this_collection_url;