diff --git a/grails-app/views/trait/_traitTableHeader.gsp b/grails-app/views/trait/_traitTableHeader.gsp
index 3c6193838..b9fa09c37 100755
--- a/grails-app/views/trait/_traitTableHeader.gsp
+++ b/grails-app/views/trait/_traitTableHeader.gsp
@@ -22,7 +22,7 @@
$( document ).ready(function() {
mpgSoftware.manhattanplotTableHeader.fillSampleGroupDropdown('<%=phenotypeKey%>');
- mpgSoftware.manhattanplotTableHeader.fillPhenotypesDropdown('T2D', 'manhattanPhenotypeDropdownWrapper','phenotypeDropdown');
+ mpgSoftware.manhattanplotTableHeader.fillPhenotypesDropdown('<%=params.trait%>' || 'T2D', 'manhattanPhenotypeDropdownWrapper','phenotypeDropdown');
mpgSoftware.manhattanplotTableHeader.fillRegionalTraitAnalysis('<%=phenotypeKey%>','');
});
diff --git a/web-app/js/lib/utils.js b/web-app/js/lib/utils.js
index 137791629..1166d25f2 100755
--- a/web-app/js/lib/utils.js
+++ b/web-app/js/lib/utils.js
@@ -386,7 +386,7 @@ var UTILS = {
}
},
// phenotypesToOmit is an array of the phenotype keys that should not be included
- fillPhenotypeCompoundDropdown: function (dataSetJson,phenotypeDropDownIdentifier,includeDefault, phenotypesToOmit,portaltype) { // help text for each row
+ fillPhenotypeCompoundDropdown: function (dataSetJson,phenotypeDropDownIdentifier,includeDefault, phenotypesToOmit,selectedPhenotype) { // help text for each row
if ((typeof dataSetJson !== 'undefined') &&
(typeof dataSetJson["is_error"] !== 'undefined')&&
(dataSetJson["is_error"] === false))
@@ -402,12 +402,20 @@ var UTILS = {
if(_.includes(phenotypesToOmit, groupContents[j][0])) {
continue;
}
- options.append($("").val(groupContents[j][0])
- // add some whitespace to create indentation
- .html(" " + groupContents[j][1]));
+ if(selectedPhenotype === groupContents[j][0]){
+ options.append($("").val(groupContents[j][0]).html(" " + groupContents[j][1]));
+ }
+ else{
+ options.append($("").val(groupContents[j][0])
+ // add some whitespace to create indentation
+ .html(" " + groupContents[j][1]));
+
+ }
+
}
options.append("");
- $(phenotypeDropDownIdentifier).selectpicker('refresh');
+ //$(phenotypeDropDownIdentifier).selectpicker('refresh');
+
});
// enable the input
options.prop('disabled', false);