Merge pull request #413 from openSNP/fix-modal-disappearance

Fix modal disappearance, closes #176
This commit is contained in:
Philipp Bayer
2017-06-20 17:13:43 +08:00
committed by GitHub
2 changed files with 10 additions and 1 deletions

View File

@@ -2,7 +2,7 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<button id="modal_close_<%= id %>" type="button" class="close" data-dismiss="modal">×</button>
<%= content_for id.to_sym%>
</div>
<div class="modal-body">

View File

@@ -25,6 +25,15 @@ $(document).ready(function() {
$("label[for=user_phenotype_variation]").hide();
});
});
// show the input-box when closing the modal
$('#<%=id%>').on('hidden.bs.modal', function (e) {
$('<%="#phenotype_field"+phenotype.id.to_s%>').show();
$("label[for=user_phenotype_variation]").show();
$("#<%=id%>").find("input:radio").prop("checked", false).end()
.buttonset("refresh");
});
// Autocomplete for variations in the input-box
$(function () {
$('<%="#phenotype_field"+phenotype.id.to_s%>').autocomplete({