Bug 34616: Add native bootstrap behaviour to default server dialog

Test plan:
Create a new SMTP server
Tick the 'default server' checkbox
Verify it now has a backdrop, closes if u click the backdrop or press 'esc'
The Yes and No buttons are now styled properly

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Pedro Amorim 2023-08-25 14:14:35 +00:00 committed by Tomas Cohen Arazi
parent 352a2afd0b
commit b9d3997063
Signed by: tomascohen
GPG key ID: 0A272EA1B2F3C15F

View file

@ -317,8 +317,8 @@
<div id="default_confirm_dialog">Are you sure you want to change the default SMTP server?</div>
</div>
<div class="modal-footer">
<a id="default_confirm_dialog" href="#" class="btn btn-default default_confirm_modal_yes" id="default_confirm_modal_button" role="button" data-toggle="modal">Yes</a>
<button class="btn btn-link default_confirm_modal_no" data-dismiss="modal" aria-hidden="true">No</button>
<a id="default_confirm_dialog" href="#" class="btn btn-primary default_confirm_modal_yes" id="default_confirm_modal_button" role="button" data-toggle="modal">Yes</a>
<button class="btn btn-default default_confirm_modal_no" data-dismiss="modal" aria-hidden="true">No</button>
</div>
</div> <!-- /.modal-content -->
</div> <!-- /.modal-dialog -->
@ -456,14 +456,14 @@
});
$('#smtp_default').on( "click", function () {
$("#default_confirm_modal").show();
$("#default_confirm_modal").modal('show');
});
$('.default_confirm_modal_yes').on( "click", function () {
$("#default_confirm_modal").hide();
$("#default_confirm_modal").modal('hide');
});
$('.default_confirm_modal_no').on( "click", function () {
$("#smtp_default").prop('checked', !$("#smtp_default").prop('checked') );
$("#default_confirm_modal").hide();
$("#default_confirm_modal").modal('hide');
});
$("#delete_confirm_modal_button").on( "click", function () {