Show confirm dialog before deleting problem
This commit is contained in:
parent
a94df0dd49
commit
765f6e0ec1
2 changed files with 32 additions and 16 deletions
|
@ -56,6 +56,8 @@ var update_problem = function(form_id) {
|
|||
};
|
||||
|
||||
var delete_problem = function(form_id) {
|
||||
$('#confirm').modal("show", { backdrop: 'static', keyboard: false })
|
||||
.one('click', '#delete', function() {
|
||||
var input = "#" + form_id + " input";
|
||||
var pid = form_id.split("_")[1];
|
||||
$(input).attr("disabled", "disabled");
|
||||
|
@ -75,4 +77,6 @@ var delete_problem = function(form_id) {
|
|||
$(input).removeAttr("disabled");
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
|
|
@ -73,6 +73,18 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div id="confirm" class="modal fade">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">Are you sure you want to delete this problem?</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" data-dismiss="modal" class="btn btn-primary" id="delete">Delete</button>
|
||||
<button type="button" data-dismiss="modal" class="btn">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$(".selectpicker").selectpicker();
|
||||
|
|
Loading…
Reference in a new issue