confirm_dialog: Make Bootstrap fade class optional.

It would be better to load non-setting modals instantly.

This was previously reverted in
7bfa607d0a due to a rebase conflict.
This commit is contained in:
Ganesh Pawar
2021-06-09 20:05:08 +05:30
committed by Tim Abbott
parent 5be92ad30d
commit 6e4735a4e9
10 changed files with 13 additions and 3 deletions

View File

@@ -105,6 +105,7 @@ export function build_user_avatar_widget(upload_function) {
html_body, html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}), html_yes_button: $t_html({defaultMessage: "Confirm"}),
on_click: delete_user_avatar, on_click: delete_user_avatar,
fade: true,
}); });
}); });

View File

@@ -32,7 +32,7 @@ import * as overlays from "./overlays";
*/ */
export function launch(conf) { export function launch(conf) {
const html = render_confirm_dialog(); const html = render_confirm_dialog({fade: conf.fade});
const confirm_dialog = $(html); const confirm_dialog = $(html);
const conf_fields = [ const conf_fields = [
@@ -47,7 +47,7 @@ export function launch(conf) {
]; ];
for (const f of conf_fields) { for (const f of conf_fields) {
if (!conf[f]) { if (conf[f] === undefined) {
blueslip.error("programmer omitted " + f); blueslip.error("programmer omitted " + f);
} }
} }

View File

@@ -251,6 +251,7 @@ export function set_up() {
html_body, html_body,
html_yes_button: $t_html({defaultMessage: "Yes"}), html_yes_button: $t_html({defaultMessage: "Yes"}),
on_click: submit_custom_emoji_request, on_click: submit_custom_emoji_request,
fade: true,
}); });
} else { } else {
submit_custom_emoji_request(); submit_custom_emoji_request();

View File

@@ -208,6 +208,7 @@ export function on_load_success(invites_data, initialize_event_handlers) {
html_body, html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}), html_yes_button: $t_html({defaultMessage: "Confirm"}),
on_click: do_revoke_invite, on_click: do_revoke_invite,
fade: true,
}); });
$(".confirm_dialog_yes_button").attr("data-invite-id", meta.invite_id); $(".confirm_dialog_yes_button").attr("data-invite-id", meta.invite_id);
@@ -233,6 +234,7 @@ export function on_load_success(invites_data, initialize_event_handlers) {
html_body, html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}), html_yes_button: $t_html({defaultMessage: "Confirm"}),
on_click: do_resend_invite, on_click: do_resend_invite,
fade: true,
}); });
$(".confirm_dialog_yes_button").attr("data-invite-id", meta.invite_id); $(".confirm_dialog_yes_button").attr("data-invite-id", meta.invite_id);

View File

@@ -1168,6 +1168,7 @@ export function build_page() {
html_body, html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}), html_yes_button: $t_html({defaultMessage: "Confirm"}),
on_click: do_deactivate_realm, on_click: do_deactivate_realm,
fade: true,
}); });
}); });
} }

View File

@@ -368,6 +368,7 @@ export function set_up() {
html_body, html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}), html_yes_button: $t_html({defaultMessage: "Confirm"}),
on_click: delete_user_group, on_click: delete_user_group,
fade: true,
}); });
}); });

View File

@@ -519,6 +519,7 @@ function confirm_deactivation(row, user_id, status_field) {
html_body, html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}), html_yes_button: $t_html({defaultMessage: "Confirm"}),
on_click: handle_confirm, on_click: handle_confirm,
fade: true,
}); });
} }

View File

@@ -872,6 +872,7 @@ export function initialize() {
html_body, html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}), html_yes_button: $t_html({defaultMessage: "Confirm"}),
on_click: remove_user_from_private_stream, on_click: remove_user_from_private_stream,
fade: true,
}); });
return; return;
} }
@@ -940,6 +941,7 @@ export function initialize() {
html_body, html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}), html_yes_button: $t_html({defaultMessage: "Confirm"}),
on_click: do_archive_stream, on_click: do_archive_stream,
fade: true,
}); });
$(".confirm_dialog_yes_button").attr("data-stream-id", stream_id); $(".confirm_dialog_yes_button").attr("data-stream-id", stream_id);

View File

@@ -971,6 +971,7 @@ export function unsubscribe_from_private_stream(sub, from_stream_popover) {
html_body, html_body,
html_yes_button: $t_html({defaultMessage: "Confirm"}), html_yes_button: $t_html({defaultMessage: "Confirm"}),
on_click: unsubscribe_from_stream, on_click: unsubscribe_from_stream,
fade: true,
}); });
} }

View File

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