confirm_dialog: Make it usable outside settings.

* Currently, the confirm_dialog is used only in
the settings pane, which already has the `new-style`
class in the main `settings_overlay.hbs` file. So,
the confirm modal is rendered correctly there. But to
make it available for use outside of the settings pane,
we add the `new-style` class to the confirm container
itself, without which, the buttons look ugly.

* The other change here is the click handler for
removing the modal element. Previously, when the
modal was closed (with any of the "yes"/"no"/"cross"
buttons), there was a small time interval of around
a second during which the modal had disappeared,
but the background content was still in the faded-out
state. This change fixes this glitch. This glitch was
probably not noticable earlier, because the settings
pane itself causes the background to be slightly faded
out.
This commit is contained in:
Abhijeet Prasad Bodas 2021-03-20 15:21:17 +05:30 committed by Tim Abbott
parent 1cc6f6158e
commit eb7b699ac9
2 changed files with 2 additions and 2 deletions

View File

@ -72,7 +72,7 @@ export function launch(conf) {
conf.on_click();
});
confirm_dialog.on("hide", () => {
confirm_dialog.on("hidden.bs.modal", () => {
confirm_dialog.remove();
});

View File

@ -1,4 +1,4 @@
<div class="modal modal-bg hide fade" id="confirm_dialog_modal" tabindex="-1" role="dialog" aria-labelledby="confirm_dialog_modal" aria-hidden="true">
<div class="modal modal-bg new-style hide fade" id="confirm_dialog_modal" tabindex="-1" role="dialog" aria-labelledby="confirm_dialog_modal" aria-hidden="true">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="{{t 'Close' }}"><span aria-hidden="true">&times;</span></button>
<h3 class="confirm_dialog_heading"></h3>