Skip to content

Commit

Permalink
hide missing genotype message after selecting valid protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
isaak committed Nov 8, 2024
1 parent b2bdbbd commit 481fd71
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions js/source/legacy/solGS/genotypingProtocol.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,23 @@
var solGS = solGS || function solGS() {};

solGS.genotypingProtocol = {
setGenotypingProtocol: function (divPlace, arg) {
var msg = "You are using genotyping protocol: <b>" + arg.name + "</b>.";
setGenotypingProtocol: function (divPlace, protocol) {
var msg = "You are using genotyping protocol: <b>" + protocol.name + "</b>.";

if (divPlace) {
divPlace = divPlace + " ";
}

jQuery(divPlace + "#genotyping_protocol #genotyping_protocol_message").val(
arg.protocol_id
protocol.protocol_id
);
jQuery(divPlace + "#genotyping_protocol #genotyping_protocol_message").html(
msg
);
jQuery(divPlace + "#genotyping_protocol #genotyping_protocol_id").val(
arg.protocol_id
protocol.protocol_id
);

},

getAllProtocols: function () {
Expand Down Expand Up @@ -164,18 +165,18 @@ jQuery(document).ready(function () {

jQuery("#genotyping_protocol #genotyping_protocols_list_select").change(
function () {
var selectedId = jQuery(this).find("option:selected").val();
var selectedName = jQuery(this).find("option:selected").text();
var selectedProtocolId = jQuery(this).find("option:selected").val();
var selectedProtocolName = jQuery(this).find("option:selected").text();

var selected = {
protocol_id: selectedId,
name: selectedName,
var selectedProtocol = {
protocol_id: selectedProtocolId,
name: selectedProtocolName,
};

var divPlace = jQuery(this).parent().parent().parent().attr("id");

divPlace = solGS.genotypingProtocol.formatId(divPlace);
solGS.genotypingProtocol.setGenotypingProtocol(divPlace, selected);
solGS.genotypingProtocol.setGenotypingProtocol(divPlace, selectedProtocol);

jQuery(
divPlace + " #genotyping_protocol #genotyping_protocols_list_div"
Expand All @@ -187,6 +188,10 @@ jQuery(document).ready(function () {
jQuery(
divPlace + " #genotyping_protocol #genotyping_protocols_change"
).show();

if (selectedProtocolId) {
jQuery("#genotype_missing_message").hide();
}
}
);
});

0 comments on commit 481fd71

Please sign in to comment.